diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2023-05-17 18:55:51 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2023-05-17 18:55:51 +0200 |
commit | 98bd4c72fd6c4f9d6a2b3b449cb89f335116ab5a (patch) | |
tree | faea75334d46783d5dcb7cdeeaf20670a0724ffc | |
parent | 69c430626b5eb44825a12e8bc90a59a90c4f5a03 (diff) | |
download | postgresql-98bd4c72fd6c4f9d6a2b3b449cb89f335116ab5a.tar.gz |
pg_dump: Have _EndLO report errno after CFH->write_func() failure
Other callers of that function do things this way, but this one didn't
get the memo.
-rw-r--r-- | src/bin/pg_dump/pg_backup_directory.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index 2177d5ff42..7f2ac7c7fd 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -697,7 +697,13 @@ _EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid) /* register the LO in blobs.toc */ len = snprintf(buf, sizeof(buf), "%u blob_%u.dat\n", oid, oid); if (!CFH->write_func(buf, len, CFH)) - pg_fatal("could not write to LOs TOC file"); + { + /* if write didn't set errno, assume problem is no disk space */ + if (errno == 0) + errno = ENOSPC; + pg_fatal("could not write to LOs TOC file: %s", + CFH->get_error_func(CFH)); + } } /* |