mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Provide the libpq error message when PQputline or PQendcopy fails.
This commit is contained in:
parent
f527f082c5
commit
f9e03aa8e9
@ -5,7 +5,7 @@
|
|||||||
* Implements the basic DB functions used by the archiver.
|
* Implements the basic DB functions used by the archiver.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.66.2.1 2006/02/05 20:58:57 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.66.2.2 2006/02/09 18:28:35 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -389,7 +389,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
|
|||||||
* to continue after an error in a COPY command.
|
* to continue after an error in a COPY command.
|
||||||
*/
|
*/
|
||||||
if (AH->pgCopyIn && PQputline(AH->connection, AH->pgCopyBuf->data) != 0)
|
if (AH->pgCopyIn && PQputline(AH->connection, AH->pgCopyBuf->data) != 0)
|
||||||
die_horribly(AH, modulename, "error returned by PQputline\n");
|
die_horribly(AH, modulename, "error returned by PQputline: %s",
|
||||||
|
PQerrorMessage(AH->connection));
|
||||||
|
|
||||||
resetPQExpBuffer(AH->pgCopyBuf);
|
resetPQExpBuffer(AH->pgCopyBuf);
|
||||||
|
|
||||||
@ -400,7 +401,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
|
|||||||
if (isEnd)
|
if (isEnd)
|
||||||
{
|
{
|
||||||
if (AH->pgCopyIn && PQendcopy(AH->connection) != 0)
|
if (AH->pgCopyIn && PQendcopy(AH->connection) != 0)
|
||||||
die_horribly(AH, modulename, "error returned by PQendcopy\n");
|
die_horribly(AH, modulename, "error returned by PQendcopy: %s",
|
||||||
|
PQerrorMessage(AH->connection));
|
||||||
|
|
||||||
AH->pgCopyIn = false;
|
AH->pgCopyIn = false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user