aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2025-04-17 09:52:47 +0900
committerFujii Masao <fujii@postgresql.org>2025-04-17 09:52:47 +0900
commite4b0f86e1fe38147b0bcf6e50862d0899a31201c (patch)
tree1d7997f6a21ebb841483c7dd4019e92f2ee9d5d8 /src
parent2e5353be2534aed99a714f99c8a193f85777e64a (diff)
downloadpostgresql-e4b0f86e1fe38147b0bcf6e50862d0899a31201c.tar.gz
postgresql-e4b0f86e1fe38147b0bcf6e50862d0899a31201c.zip
pg_dump: Fix incorrect archive format shown in error message.
In pg_dump and pg_restore, _allocAH() calls _discoverArchiveFormat() to determine the archive format when the input format is unknown one. If the input or discovered format is unrecognized, it reports an error including the archive format number. If discovered format is unrecognized, its number should be shown in the error message. But previously the error message mistakenly showed the originally requested format number (i.e., unknown one) instead of the discovered one, due to referencing the wrong variable in the error message. This commit corrects the issue by using the appropriate variable in the error message. This fix has no practical impact since _discoverArchiveFormat() never returns an unrecognized format and that error mesasge is actually never output. Therefore, while the issue exists in back branches, it's not worth the trouble and buildfarm cycles to back-patch. So this fix is applied only to the master branch. Author: Mahendra Singh Thalor <mahi6run@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Fujii Masao <masao.fujii@gmail.com> Discussion: https://postgr.es/m/CAKYtNAqu+N-Ab2Fq6wzNSOm_-0N-BMneanYNV1+6kFDXjva1Eg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index f961162f365..afa42337b11 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -2469,7 +2469,7 @@ _allocAH(const char *FileSpec, const ArchiveFormat fmt,
break;
default:
- pg_fatal("unrecognized file format \"%d\"", fmt);
+ pg_fatal("unrecognized file format \"%d\"", AH->format);
}
return AH;