pgsql: pg_restore: Fix incompatibilities with extracted tar dumps.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pg_restore: Fix incompatibilities with extracted tar dumps.
Date: 2026-11-23 18:32:36
Message-ID: E1xVYqB-000000003FN-2Ji9@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pg_restore: Fix incompatibilities with extracted tar dumps.

Extracting a tar-format archive is supposed to produce a valid
directory-format archive. Each BLOBS entry in the archive's table
of contents (TOC) names a file that lists the large objects to
restore, but the tar format puts the wrong file name into these
entries. As a result, pg_restore fails to restore large objects
from an extracted tar archive, and parallel restore can't estimate
their size.

To fix, construct the file name instead of using the one in the
TOC entry, as commit 166b4f4560 did for directory-format archives
made by versions before v12. This commit doesn't change the name
recorded by the tar format, as that wouldn't help with existing
archives.

Reviewed-by: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Reviewed-by: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://postgr.es/m/av9o1Fi3PQ-jqmGO%40nathan
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/732c475ff803de84136fc79860d535187d9f6986

Modified Files
--------------
src/bin/pg_dump/pg_backup_directory.c | 29 +++++++++++++++++++++++++----
1 file changed, 25 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Dean Rasheed 2026-11-23 19:22:42 pgsql: Record dependencies on the target columns of MERGE actions.
Previous Message Dean Rasheed 2026-11-23 12:21:01 pgsql: Fix cross-partition source values in MERGE after a concurrent up