From 1a7376acef244603fee84a199d7a28270b865e7f Mon Sep 17 00:00:00 2001
From: Florents Tselai <florents.tselai@gmail.com>
Date: Thu, 26 Sep 2024 01:24:35 +0300
Subject: [PATCH v1] Note on -e, -t, -n

---
 doc/src/sgml/ref/pg_dump.sgml    | 41 +++++++++-----------------------
 doc/src/sgml/ref/pg_restore.sgml | 21 ++++++++--------
 2 files changed, 22 insertions(+), 40 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index ffc29b04fb..c8971cd30e 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -247,16 +247,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>
 
@@ -431,16 +421,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
@@ -581,16 +561,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>
 
@@ -1589,6 +1559,17 @@ CREATE DATABASE foo WITH TEMPLATE template0;
    catalogs might be left in the wrong state.
   </para>
 
+  <para>
+   When <option>-e</option>, <option>-n</option> or <option>-t</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-table or specific-schema dump can be successfully restored by themselves
+   into a clean database.
+   For <option>-e</option> in particular, note that the referred extension
+   must be installed (i.e. its shared object) separately, before it can be restored.
+  </para>
+
   <para>
    The dump file produced by <application>pg_dump</application>
    does not contain the statistics used by the optimizer to make
diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml
index b8b27e1719..00132f3000 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -519,16 +519,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>
@@ -995,6 +985,17 @@ PostgreSQL documentation
  <refsect1 id="app-pgrestore-notes">
   <title>Notes</title>
 
+  <para>
+   When <option>-n</option> or <option>-t</option>  is 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 <command>pg_restore -t A</command> is requested,
+   and <literal>A</literal> has foreign key constraints to table <literal>B</literal>,
+   <literal>B</literal> should have been restored prior to that.
+  </para>
+
   <para>
    If your installation has any local additions to the
    <literal>template1</literal> database, be careful to load the output of
-- 
2.39.5 (Apple Git-154)

