diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-02-09 18:28:43 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-02-09 18:28:43 +0000 |
commit | f28106381a8f03c8c32d27c8f94934b5a8726262 (patch) | |
tree | 8f064bcc0f2878dde101182c9dab05ab7209cb05 | |
parent | a14302080fc90ef419b94c92f246665aaa51e194 (diff) | |
download | postgresql-f28106381a8f03c8c32d27c8f94934b5a8726262.tar.gz postgresql-f28106381a8f03c8c32d27c8f94934b5a8726262.zip |
Provide the libpq error message when PQputline or PQendcopy fails.
-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 8135e50ae19..b417128111f 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.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; } |