pg_restore: fix incompatibility with old directory-format dumps. master github/master
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 8 Jun 2025 21:06:39 +0000 (17:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 8 Jun 2025 21:06:39 +0000 (17:06 -0400)
commit166b4f4560d68e2bcf0f82eb898ac5ee15147b82
treebd5ff2351f7fbeb6e16453b18daf178be3b8cbce
parent7d4667c6203d0174903a53de9d1730fbec26576b
pg_restore: fix incompatibility with old directory-format dumps.

pg_restore failed to restore large objects (blobs) out of
directory-format dumps made by versions before PG v12.
That's because, due to a bug fixed in commit 548e50976, those
old versions put the wrong filename into the BLOBS TOC entry.
Said bug was harmless before v17, because we ignored the
incorrect filename field --- but commit a45c78e32 assumed it
would be correct.

Reported-by: Pavel Stehule <pavel.stehule@gmail.com>
Author: Pavel Stehule <pavel.stehule@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAFj8pRCrZ=_e1Rv1N+6vDaH+6gf=9A2mE2J4RvnvKA1bLiXvXA@mail.gmail.com
Backpatch-through: 17
src/bin/pg_dump/pg_backup_directory.c