mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-11 19:20:40 +08:00
Provide the libpq error message when PQputline or PQendcopy fails.
This commit is contained in:
parent
a14302080f
commit
f28106381a
@ -5,7 +5,7 @@
|
||||
* Implements the basic DB functions used by the archiver.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.61.4.2 2006/02/05 20:59:06 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.61.4.3 2006/02/09 18:28:43 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -407,7 +407,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
|
||||
*/
|
||||
|
||||
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);
|
||||
|
||||
@ -418,7 +419,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
|
||||
if (isEnd)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user