public inbox for [email protected]  
help / color / mirror / Atom feed
From: vaibhave postgres <[email protected]>
To: [email protected]
Subject: docs: warn about post-data-only schema dumps with parallel restore.
Date: Mon, 26 Jan 2026 10:53:19 +0530
Message-ID: <CAM_eQjzTLtt1X9WKvMV6Rew0UvxT3mmhimZa9WT-vqaPjmXk-g@mail.gmail.com> (raw)

Hi hackers,

Following up on the discussion in [1] about pg_restore failing to restore
post-data items due to circular foreign key deadlocks.

I’m attaching a doc patch that adds a warning about using post-data-only
schema dumps together with parallel restore.

Thanks.

[1] Re: pg_restore: fails to restore post-data items due to circular FK
deadlock - Mailing list pgsql-bugs : Postgres Professional
<https://postgrespro.com/list/id/[email protected];


Attachments:

  [application/octet-stream] 0001-doc-warn-about-post-data-only-schema-dumps-with-para.patch (1.4K, 3-0001-doc-warn-about-post-data-only-schema-dumps-with-para.patch)
  download | inline diff:
From 2d438278debf43215e2185611d2f996d09886268 Mon Sep 17 00:00:00 2001
From: Vaibhave Sekar <[email protected]>
Date: Sun, 25 Jan 2026 10:54:00 +0000
Subject: [PATCH] doc: warn about post-data-only schema dumps with parallel
 restore.

---
 doc/src/sgml/ref/pg_dump.sgml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 5ba167b33e7..cc410e00d7f 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -1272,6 +1272,17 @@ PostgreSQL documentation
           and constraints other than validated check constraints.
           Pre-data items include all other data definition items.
          </para>
+           <note>
+            <para>
+             Archives that contain only <option>post-data</option> omit table entries.
+             When such an archive is restored in parallel, constraint creation can
+             fail because <application>pg_restore</application> cannot order foreign
+             keys that depend on tables not present in the archive.  To avoid this,
+             take a schema-inclusive dump (for example, <option>--schema-only</option>
+             or the default), then filter sections at restore time, or restore the
+             post-data-only archive with <option>-j1</option>.
+            </para>
+           </note>
        </listitem>
      </varlistentry>
 
-- 
2.43.0



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]
  Subject: Re: docs: warn about post-data-only schema dumps with parallel restore.
  In-Reply-To: <CAM_eQjzTLtt1X9WKvMV6Rew0UvxT3mmhimZa9WT-vqaPjmXk-g@mail.gmail.com>

* 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