From: Tom Lane Date: Thu, 9 Feb 2006 18:28:35 +0000 (+0000) Subject: Provide the libpq error message when PQputline or PQendcopy fails. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e60b6534eb04b4d70b183ccc2ed19aebf36211ec;p=users%2Fbernd%2Fpostgres.git Provide the libpq error message when PQputline or PQendcopy fails. --- diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index 29ed7f9d8f..1b4f484bc2 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -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; }