From: Tom Lane Date: Thu, 9 Feb 2006 18:28:43 +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=1da2d530cd2d0c8bc1adae56259ec54b9a04efe4;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 2d49cbed1f..67a481a56e 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -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; }