Skip to content

Commit 2827516

Browse files
committed
Also print the libpq error message when lo_create or lo_open fails
1 parent a401226 commit 2827516

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.182 2010/02/26 02:01:16 momjian Exp $
18+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.183 2010/03/18 20:00:51 petere Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -935,13 +935,13 @@ StartRestoreBlob(ArchiveHandle *AH, Oid oid, bool drop)
935935
{
936936
loOid = lo_create(AH->connection, oid);
937937
if (loOid == 0 || loOid != oid)
938-
die_horribly(AH, modulename, "could not create large object %u\n",
939-
oid);
938+
die_horribly(AH, modulename, "could not create large object %u: %s",
939+
oid, PQerrorMessage(AH->connection));
940940
}
941941
AH->loFd = lo_open(AH->connection, oid, INV_WRITE);
942942
if (AH->loFd == -1)
943-
die_horribly(AH, modulename, "could not open large object %u\n",
944-
oid);
943+
die_horribly(AH, modulename, "could not open large object %u: %s",
944+
oid, PQerrorMessage(AH->connection));
945945
}
946946
else
947947
{

src/bin/pg_dump/pg_dump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
2626
*
2727
* IDENTIFICATION
28-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.578 2010/03/11 04:36:43 tgl Exp $
28+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.579 2010/03/18 20:00:51 petere Exp $
2929
*
3030
*-------------------------------------------------------------------------
3131
*/
@@ -2117,7 +2117,7 @@ dumpBlobs(Archive *AH, void *arg)
21172117
loFd = lo_open(g_conn, blobOid, INV_READ);
21182118
if (loFd == -1)
21192119
{
2120-
write_msg(NULL, "dumpBlobs(): could not open large object %u: %s",
2120+
write_msg(NULL, "could not open large object %u: %s",
21212121
blobOid, PQerrorMessage(g_conn));
21222122
exit_nicely();
21232123
}
@@ -2130,7 +2130,7 @@ dumpBlobs(Archive *AH, void *arg)
21302130
cnt = lo_read(g_conn, loFd, buf, LOBBUFSIZE);
21312131
if (cnt < 0)
21322132
{
2133-
write_msg(NULL, "dumpBlobs(): error reading large object %u: %s",
2133+
write_msg(NULL, "error reading large object %u: %s",
21342134
blobOid, PQerrorMessage(g_conn));
21352135
exit_nicely();
21362136
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy