diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-02-09 18:28:35 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-02-09 18:28:35 +0000 |
commit | f9e03aa8e9723ecda49059486b3f5124125bb64d (patch) | |
tree | d650df068ddd8f1560a3c7eb912cfbdcc1018884 /src | |
parent | f527f082c55c1f4b9fe0783e10b135b372fca7e1 (diff) | |
download | postgresql-f9e03aa8e9723ecda49059486b3f5124125bb64d.tar.gz postgresql-f9e03aa8e9723ecda49059486b3f5124125bb64d.zip |
Provide the libpq error message when PQputline or PQendcopy fails.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_dump/pg_backup_db.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index 3057b04589e..3cb29b0d346 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -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.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. */ 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); @@ -400,7 +401,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; } |