public inbox for [email protected]  
help / color / mirror / Atom feed
From: Dimitrios Apostolou <[email protected]>
To: David G. Johnston <[email protected]>
Cc: [email protected]
Subject: Re: In-order pg_dump (or in-order COPY TO)
Date: Wed, 27 Aug 2025 14:40:57 +0200 (CEST)
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAKFQuwYBVFjoNFUzsomdvRQXEEQH5A4T-+_STE=WNUomw6LZSQ@mail.gmail.com>
References: <[email protected]>
	<CAKFQuwYBVFjoNFUzsomdvRQXEEQH5A4T-+_STE=WNUomw6LZSQ@mail.gmail.com>

On Tuesday 2025-08-26 22:31, David G. Johnston 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.  For adhoc work you can use "COPY <query> TO ..." and put and order by in the query.

Thank you, so it's not possible currently.

How would "COPY <query> TO" behave for copying very large tables?
Would it make sense to optionally have that in pg_dump?

Or would it make sense as a new feature, to optionally order "COPY 
<table> TO ..." based on primary key where available, and use that in 
pg_dump option?

Dimitris


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], [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