public inbox for [email protected]  
help / color / mirror / Atom feed
Re: In-order pg_dump (or in-order COPY TO)
2+ messages / 2 participants
[nested] [flat]

* Re: In-order pg_dump (or in-order COPY TO)
@ 2025-09-01 17:54  Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Tom Lane @ 2025-09-01 17:54 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: Dimitrios Apostolou <[email protected]>; [email protected]

Adrian Klaver <[email protected]> writes:
> I did some digging in the code and see that the TOC is more then that, 
> it stores a range of data. Still have not part where the offsets are 
> ignored for writes to stdout, but will keep on digging.

The TOC is initially written out with zeroes for the offsets.
Then the per-table data parts are written out, tracking where
each one begins.  At the end, if the output file is seekable,
pg_dump seeks back to the start and re-writes the whole TOC
section, now with data offsets populated.  But output to a
pipe won't be seekable.

			regards, tom lane






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: In-order pg_dump (or in-order COPY TO)
@ 2025-09-01 19:02  Adrian Klaver <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Adrian Klaver @ 2025-09-01 19:02 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; +Cc: Dimitrios Apostolou <[email protected]>; [email protected]

On 9/1/25 10:54, Tom Lane wrote:
> Adrian Klaver <[email protected]> writes:
>> I did some digging in the code and see that the TOC is more then that,
>> it stores a range of data. Still have not part where the offsets are
>> ignored for writes to stdout, but will keep on digging.
> 
> The TOC is initially written out with zeroes for the offsets.
> Then the per-table data parts are written out, tracking where
> each one begins.  At the end, if the output file is seekable,
> pg_dump seeks back to the start and re-writes the whole TOC
> section, now with data offsets populated.  But output to a
> pipe won't be seekable.

Got it, thanks.

> 
> 			regards, tom lane


-- 
Adrian Klaver
[email protected]






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-09-01 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-01 17:54 Re: In-order pg_dump (or in-order COPY TO) Tom Lane <[email protected]>
2025-09-01 19:02 ` Adrian Klaver <[email protected]>

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