postgresql/src/bin/pg_dump
Daniel Gustafsson 3e2f32b01d Fix bug in TOC file error message printing
If the blob TOC file cannot be parsed, the error message was failing
to print the filename as the variable holding it was shadowed by the
destination buffer for parsing.  When the filename fails to parse,
the error will print an empty string:

 ./pg_restore -d foo -F d dump
 pg_restore: error: invalid line in large object TOC file "": ..

..instead of the intended error message:

 ./pg_restore -d foo -F d dump
 pg_restore: error: invalid line in large object TOC file "dump/blobs.toc": ..

Fix by renaming both variables as the shared name was too generic to
store either and still convey what the variable held.

Backpatch all the way down to 9.6.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/A2B151F5-B32B-4F2C-BA4A-6870856D9BDE@yesql.se
Backpatch-through: 9.6
2021-10-19 12:59:54 +02:00
..
po Translation updates 2021-09-20 16:23:13 +02:00
t Don't print extra parens around expressions in extended stats 2021-09-01 00:44:12 +02:00
.gitignore Clean up after pg_dump test runs. 2016-05-06 22:28:01 -04:00
common.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
compress_io.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
compress_io.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
dumputils.c Fix pg_dump for GRANT OPTION among initial privileges. 2021-01-16 12:21:35 -08:00
dumputils.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
Makefile Update copyright for 2021 2021-01-02 13:06:25 -05:00
nls.mk Translation updates 2021-09-20 16:23:13 +02:00
parallel.c Factor out system call names from error messages 2021-04-23 14:21:37 +02:00
parallel.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_backup.h Rethink definition of pg_attribute.attcompression. 2021-05-27 13:24:27 -04:00
pg_backup_archiver.c Work around portability issue with newer versions of mktime(). 2021-06-13 14:32:42 -04:00
pg_backup_archiver.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
pg_backup_custom.c Yet more elimination of dead stores and useless initializations. 2020-09-05 13:17:32 -04:00
pg_backup_db.c Avoid redundantly prefixing PQerrorMessage for a connection failure. 2021-01-22 16:52:31 -05:00
pg_backup_db.h Revert "pg_dump: Lock all relations, not just plain tables". 2020-11-06 15:48:04 -05:00
pg_backup_directory.c Fix bug in TOC file error message printing 2021-10-19 12:59:54 +02:00
pg_backup_null.c Remove useless "return;" lines 2019-11-28 16:48:37 -03:00
pg_backup_tar.c Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
pg_backup_tar.h Fix tar files emitted by pg_dump and pg_basebackup to be POSIX conformant. 2012-09-28 15:19:15 -04:00
pg_backup_utils.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_backup_utils.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
pg_dump.c Avoid core dump in pg_dump when dumping from pre-8.3 server. 2021-10-16 15:03:05 -04:00
pg_dump.h Cache the results of format_type() queries in pg_dump. 2021-08-31 13:53:49 -04:00
pg_dump_sort.c Dump ALTER TABLE ... ATTACH PARTITION as a separate ArchiveEntry. 2021-01-11 21:09:18 -05:00
pg_dumpall.c Add --no-toast-compression to pg_dumpall 2021-05-19 09:38:48 +09:00
pg_restore.c Fix handling of -d "connection string" in pg_dump/pg_restore. 2020-09-24 18:19:38 -04:00