Skip to content

Commit feb942b

Browse files
alvherreCommitfest Bot
authored andcommitted
Add note to pg_dump/pg_restore pages
Author: Florents Tselai <[email protected]> Discussion: https://postgr.es/m/[email protected]
1 parent a95e3d8 commit feb942b

File tree

2 files changed

+21
-40
lines changed

2 files changed

+21
-40
lines changed

doc/src/sgml/ref/pg_dump.sgml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,6 @@ PostgreSQL documentation
261261
dump if its extension is specified by <option>--extension</option>.
262262
</para>
263263

264-
<note>
265-
<para>
266-
When <option>-e</option> is specified,
267-
<application>pg_dump</application> makes no attempt to dump any other
268-
database objects that the selected extension(s) might depend upon.
269-
Therefore, there is no guarantee that the results of a
270-
specific-extension dump can be successfully restored by themselves
271-
into a clean database.
272-
</para>
273-
</note>
274264
</listitem>
275265
</varlistentry>
276266

@@ -445,16 +435,6 @@ PostgreSQL documentation
445435
<xref linkend="pg-dump-examples"/> below.
446436
</para>
447437

448-
<note>
449-
<para>
450-
When <option>-n</option> is specified, <application>pg_dump</application>
451-
makes no attempt to dump any other database objects that the selected
452-
schema(s) might depend upon. Therefore, there is no guarantee
453-
that the results of a specific-schema dump can be successfully
454-
restored by themselves into a clean database.
455-
</para>
456-
</note>
457-
458438
<note>
459439
<para>
460440
Non-schema objects such as large objects are not dumped when <option>-n</option> is
@@ -596,16 +576,6 @@ PostgreSQL documentation
596576
be dumped.
597577
</para>
598578

599-
<note>
600-
<para>
601-
When <option>-t</option> is specified, <application>pg_dump</application>
602-
makes no attempt to dump any other database objects that the selected
603-
table(s) might depend upon. Therefore, there is no guarantee
604-
that the results of a specific-table dump can be successfully
605-
restored by themselves into a clean database.
606-
</para>
607-
</note>
608-
609579
</listitem>
610580
</varlistentry>
611581

@@ -1689,6 +1659,17 @@ CREATE DATABASE foo WITH TEMPLATE template0;
16891659
</programlisting>
16901660
</para>
16911661

1662+
<para>
1663+
When options <option>-e</option>, <option>-n</option> or <option>-t</option>
1664+
are specified, <application>pg_dump</application> makes no attempt to dump
1665+
any other database objects that the selected object(s) might depend upon.
1666+
Therefore, there is no guarantee that the results of a dump so generated
1667+
can be successfully restored by themselves into a clean database.
1668+
For example, if a table whose definition includes a foreign key is
1669+
specified to be restore, the table referenced by the foreign key is
1670+
not automatically restored.
1671+
</para>
1672+
16921673
<para>
16931674
When a dump without schema is chosen and the option <option>--disable-triggers</option>
16941675
is used, <application>pg_dump</application> emits commands

doc/src/sgml/ref/pg_restore.sgml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,6 @@ PostgreSQL documentation
452452
specify table(s) in a particular schema.
453453
</para>
454454

455-
<note>
456-
<para>
457-
When <option>-t</option> is specified, <application>pg_restore</application>
458-
makes no attempt to restore any other database objects that the
459-
selected table(s) might depend upon. Therefore, there is no
460-
guarantee that a specific-table restore into a clean database will
461-
succeed.
462-
</para>
463-
</note>
464-
465455
<note>
466456
<para>
467457
This flag does not behave identically to the <option>-t</option>
@@ -1089,6 +1079,16 @@ PostgreSQL documentation
10891079
<refsect1 id="app-pgrestore-notes">
10901080
<title>Notes</title>
10911081

1082+
<para>
1083+
When options <option>-n</option> or <option>-t</option> are specified,
1084+
<application>pg_restore</application> makes no attempt to restore
1085+
any other database objects that the selected table(s) or schema(s)
1086+
might depend upon. Therefore, there is no guarantee that a specific-table
1087+
restore into a clean database will succeed. For example, if a table
1088+
whose definition includes a foreign key is specified to be restore, the
1089+
table referenced by the foreign key is not automatically restored.
1090+
</para>
1091+
10921092
<para>
10931093
If your installation has any local additions to the
10941094
<literal>template1</literal> database, be careful to load the output of

0 commit comments

Comments
 (0)