public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: In-order pg_dump (or in-order COPY TO)
Date: Tue, 26 Aug 2025 18:17:28 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaAbzGqQK7b6jF-0nuvCf6_JyD7AkSHWqbY4NnP5adfeRg@mail.gmail.com>
References: <[email protected]>
<CAKFQuwYBVFjoNFUzsomdvRQXEEQH5A4T-+_STE=WNUomw6LZSQ@mail.gmail.com>
<CANzqJaAbzGqQK7b6jF-0nuvCf6_JyD7AkSHWqbY4NnP5adfeRg@mail.gmail.com>
Ron Johnson <[email protected]> writes:
> On Tue, Aug 26, 2025 at 4:31 PM David G. Johnston <
> [email protected]> wrote:
>> The logical dump has no ordering - it will come out however it comes out.
>> "COPY <table> TO ..." doesn't have an order by clause - there is no way to
>> make or communicate to it that ordering is important.
> Doesn't COPY TO copy out records in the order they appeared in the physical
> files?
It emits whatever a sequential-scan plan would emit. If you set
synchronize_seqscans = off (which pg_dump does), that will match
physical row order.
At least with our standard table AM. If you're using Aurora or
one of those other PG forks with proprietary storage layers,
you'd have to ask them.
I suspect the OP's problem is not row order per se, but differing
TIDs or XIDs, which are things pg_dump does not endeavor to
replicate. Or, given that he said something about blocks, maybe
he's actually sensitive to where the free space is.
regards, tom lane
view thread (22+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: In-order pg_dump (or in-order COPY TO)
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox