Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps
Date: 2025-06-08 20:38:40
Message-ID: 230992.1749415120@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> It is a problem of PostgreSQL 11 - the pg_dump from PostgreSQL 12 sets
> filename correctly,
> and pg_restore doesn't need patching (in this case).

Yeah. It looks like the actual filename was always "blobs.toc" before
v17, but prior to 548e50976 pg_backup_directory.c's _ArchiveEntry put
the wrong filename into tctx->filename. That had no visible effect,
because _StartBlobs and _LoadBlobs ignored that field and hard-wired
the filename to use. Then in a45c78e32 I made those functions rely on
tctx->filename instead of hard-wiring "blobs.toc", so they fail on
archives made by versions before 548e50976.

I think your patch is about the right thing to do, although I'm
inclined to check for K_VERS_1_14 which is closer to when the
fix was made.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-06-08 21:09:20 Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps
Previous Message Pavel Stehule 2025-06-08 20:11:26 Re: Sanding down some edge cases for PL/pgSQL reserved words