Re: In-order pg_dump (or in-order COPY TO)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: In-order pg_dump (or in-order COPY TO)
Date: 2025-08-26 22:23:45
Message-ID: 1274776.1756247025@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron Johnson <ronljohnsonjr(at)gmail(dot)com> writes:
> On Tue, Aug 26, 2025 at 6:08 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I'd expect pg_dump/pg_restore to preserve the physical row ordering,
>> simply because it doesn't do anything that would change that.

> But the rolling checksums are against a pg_dump file, not a pg_basebackup
> file.

Oh, that wasn't clear to me.

> What probably changed are table OIDs. Would that change the ordering of
> COPY data in post-restore dump files?

It would not change the order of data within any one table. There are
corner cases in which different OID assignments can cause pg_dump to
emit database objects in a different order, see this recent thread:

https://www.postgresql.org/message-id/flat/20250707192654.9e.nmisch%40google.com

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-08-26 22:54:52 Re: In-order pg_dump (or in-order COPY TO)
Previous Message Tom Lane 2025-08-26 22:17:28 Re: In-order pg_dump (or in-order COPY TO)