agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Álvaro Herrera <[email protected]>
Subject: [PATCH v2] Add note to pg_dump/pg_restore pages
Date: Sat, 25 Oct 2025 19:26:28 +0300
Author: Florents Tselai <[email protected]>
Discussion: https://postgr.es/m/[email protected]
---
doc/src/sgml/ref/pg_dump.sgml | 41 +++++++++-----------------------
doc/src/sgml/ref/pg_restore.sgml | 20 ++++++++--------
2 files changed, 21 insertions(+), 40 deletions(-)
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index fd4ecf01a0a..17b5be26615 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -261,16 +261,6 @@ PostgreSQL documentation
dump if its extension is specified by <option>--extension</option>.
</para>
- <note>
- <para>
- When <option>-e</option> is specified,
- <application>pg_dump</application> makes no attempt to dump any other
- database objects that the selected extension(s) might depend upon.
- Therefore, there is no guarantee that the results of a
- specific-extension dump can be successfully restored by themselves
- into a clean database.
- </para>
- </note>
</listitem>
</varlistentry>
@@ -445,16 +435,6 @@ PostgreSQL documentation
<xref linkend="pg-dump-examples"/> below.
</para>
- <note>
- <para>
- When <option>-n</option> is specified, <application>pg_dump</application>
- makes no attempt to dump any other database objects that the selected
- schema(s) might depend upon. Therefore, there is no guarantee
- that the results of a specific-schema dump can be successfully
- restored by themselves into a clean database.
- </para>
- </note>
-
<note>
<para>
Non-schema objects such as large objects are not dumped when <option>-n</option> is
@@ -596,16 +576,6 @@ PostgreSQL documentation
be dumped.
</para>
- <note>
- <para>
- When <option>-t</option> is specified, <application>pg_dump</application>
- makes no attempt to dump any other database objects that the selected
- table(s) might depend upon. Therefore, there is no guarantee
- that the results of a specific-table dump can be successfully
- restored by themselves into a clean database.
- </para>
- </note>
-
</listitem>
</varlistentry>
@@ -1689,6 +1659,17 @@ CREATE DATABASE foo WITH TEMPLATE template0;
</programlisting>
</para>
+ <para>
+ When options <option>-e</option>, <option>-n</option> or <option>-t</option>
+ are specified, <application>pg_dump</application> makes no attempt to dump
+ any other database objects that the selected object(s) might depend upon.
+ Therefore, there is no guarantee that the results of a dump so generated
+ can be successfully restored by themselves into a clean database.
+ For example, if a table whose definition includes a foreign key is
+ specified to be restore, the table referenced by the foreign key is
+ not automatically restored.
+ </para>
+
<para>
When a dump without schema is chosen and the option <option>--disable-triggers</option>
is used, <application>pg_dump</application> emits commands
diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml
index a468a38361a..8ceff99714d 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -452,16 +452,6 @@ PostgreSQL documentation
specify table(s) in a particular schema.
</para>
- <note>
- <para>
- When <option>-t</option> is specified, <application>pg_restore</application>
- makes no attempt to restore any other database objects that the
- selected table(s) might depend upon. Therefore, there is no
- guarantee that a specific-table restore into a clean database will
- succeed.
- </para>
- </note>
-
<note>
<para>
This flag does not behave identically to the <option>-t</option>
@@ -1089,6 +1079,16 @@ PostgreSQL documentation
<refsect1 id="app-pgrestore-notes">
<title>Notes</title>
+ <para>
+ When options <option>-n</option> or <option>-t</option> are specified,
+ <application>pg_restore</application> makes no attempt to restore
+ any other database objects that the selected table(s) or schema(s)
+ might depend upon. Therefore, there is no guarantee that a specific-table
+ restore into a clean database will succeed. For example, if a table
+ whose definition includes a foreign key is specified to be restore, the
+ table referenced by the foreign key is not automatically restored.
+ </para>
+
<para>
If your installation has any local additions to the
<literal>template1</literal> database, be careful to load the output of
--
2.47.3
--jqhwfdsombb5cofo--
view thread (3+ messages)
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: [PATCH v2] Add note to pg_dump/pg_restore pages
In-Reply-To: <no-message-id-1837152@localhost>
* 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