From 8222a588e555aa9983b2eedeb26b267c28cfed24 Mon Sep 17 00:00:00 2001
From: Florents Tselai <florents.tselai@gmail.com>
Date: Mon, 5 Jan 2026 19:03:17 +0200
Subject: [PATCH v3] Docs: Consolidate dependency notes in pg_dump and
 pg_restore

Previously, pg_dump had repetitive notes attached to the -n (schema),
-t (table), and -e (extension) switches warning that dependent database
objects are not automatically included. pg_restore had a similar note
for -t but lacked one for -n.

This commit removes the individual per-switch notes and replaces them
with a consolidated paragraph in the "Notes" section of both reference
pages.

Additionally, the removed note for the -e switch in pg_dump is replaced
with a specific warning that extension installation files (such as
shared libraries and control files) are not included in the dump and
must be present on the destination system.
---
 doc/src/sgml/ref/pg_dump.sgml    | 22 ++++++++++++++++------
 doc/src/sgml/ref/pg_restore.sgml | 20 ++++++++++----------
 2 files changed, 26 insertions(+), 16 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 688e23c0e90..011a9a6f97e 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -263,14 +263,13 @@ PostgreSQL documentation
 
        <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.
+         <application>pg_dump</application> does not dump the extension's
+         underlying installation files (such as shared libraries or control
+         files). These must be available on the destination system for the
+         restore to succeed.
         </para>
        </note>
+
       </listitem>
      </varlistentry>
 
@@ -1689,6 +1688,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 restored, 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..9bdbb7e1a7d 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 restored, 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.52.0

