Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitff2cc83

Browse files
committed
Provide the libpq error message when PQputline or PQendcopy fails.
1 parent46a25ce commitff2cc83

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/bin/pg_dump/pg_backup_db.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*Implements the basic DB functions used by the archiver.
66
*
77
* IDENTIFICATION
8-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.67 2006/02/05 20:58:47 tgl Exp $
8+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_db.c,v 1.68 2006/02/09 18:28:29 tgl Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -389,7 +389,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
389389
* to continue after an error in a COPY command.
390390
*/
391391
if (AH->pgCopyIn&&PQputline(AH->connection,AH->pgCopyBuf->data)!=0)
392-
die_horribly(AH,modulename,"error returned by PQputline\n");
392+
die_horribly(AH,modulename,"error returned by PQputline: %s",
393+
PQerrorMessage(AH->connection));
393394

394395
resetPQExpBuffer(AH->pgCopyBuf);
395396

@@ -400,7 +401,8 @@ _sendCopyLine(ArchiveHandle *AH, char *qry, char *eos)
400401
if (isEnd)
401402
{
402403
if (AH->pgCopyIn&&PQendcopy(AH->connection)!=0)
403-
die_horribly(AH,modulename,"error returned by PQendcopy\n");
404+
die_horribly(AH,modulename,"error returned by PQendcopy: %s",
405+
PQerrorMessage(AH->connection));
404406

405407
AH->pgCopyIn= false;
406408
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp