pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: pg_restore fails on extracted tar archives with large objects
Date: Fri, 20 Nov 2026 08:04:19 +0000
Message-ID: <av//A7/fudljFB52@bdtpg> (raw)
In-Reply-To: <av9o1Fi3PQ-jqmGO@nathan>
References: <av9o1Fi3PQ-jqmGO@nathan>

Hi,

On Thu, Nov 19, 2026 at 03:23:32PM -0600, Nathan Bossart wrote:
> The following commands produce an error:
> 
>     createdb src
>     createdb dst
>     psql src -c "select lo_from_bytea(1, '\xff')"
>     pg_dump -Ft -f d.tar src
>     mkdir ex
>     tar xf d.tar -C ex
>     pg_restore -Fd -d dst ex
> 
>     pg_restore: error: could not open large object TOC file "ex/2966.dat" for input: No such file or directory
> 
> This is because the tar format puts NNN.dat instead of blobs_NNN.toc into
> the BLOBS TOC entry.  That was harmless until commit a45c78e328 (v17)
> taught the directory format's restore code to use the file name in the TOC
> entry.  Commit 166b4f4560 fixed a similar problem for directory-format
> dumps made by versions before v12.
> 
> The attached patch fixes it by constructing the file name instead of using
> the one in the TOC entry. 

It looks like _PrepParallelRestore() is affected by the same issue. The stat()
fails, leaving the BLOBS entry’s dataLength at zero, so the parallel scheduler
cannot use the intended size estimate. Should this use the same filename
construction as _LoadLOs()?

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com






view thread (6+ messages)  latest in thread

Message-ID: <av//A7/fudljFB52@bdtpg>
Permalink:  ../av%2F%2FA7%2FfudljFB52@bdtpg/
Also on:    postgresql.org/message-id/av//A7/fudljFB52@bdtpg

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com, nathandbossart@gmail.com
  Subject: Re: pg_restore fails on extracted tar archives with large objects
  In-Reply-To: <av//A7/fudljFB52@bdtpg>
  References: <av9o1Fi3PQ-jqmGO@nathan> <av//A7/fudljFB52@bdtpg>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox