From fd29838ed606e2049d635cf0193d8a6287e83a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= Date: Sat, 25 Oct 2025 19:26:28 +0300 Subject: [PATCH] Add note to pg_dump/pg_restore pages Author: Florents Tselai Discussion: https://postgr.es/m/284C4D55-4F90-4AA0-84C8-1E6A28DDF271@gmail.com --- 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 688e23c0e908..e88a05828ca0 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 . - - - When is specified, - pg_dump 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. - - @@ -445,16 +435,6 @@ PostgreSQL documentation below. - - - When is specified, pg_dump - 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. - - - Non-schema objects such as large objects are not dumped when is @@ -596,16 +576,6 @@ PostgreSQL documentation be dumped. - - - When is specified, pg_dump - 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. - - - @@ -1689,6 +1659,17 @@ CREATE DATABASE foo WITH TEMPLATE template0; + + When options , or + are specified, pg_dump 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. + + When a dump without schema is chosen and the option is used, pg_dump emits commands diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index a468a38361a1..8ceff99714df 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. - - - When is specified, pg_restore - 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. - - - This flag does not behave identically to the @@ -1089,6 +1079,16 @@ PostgreSQL documentation Notes + + When options or are specified, + pg_restore 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. + + If your installation has any local additions to the template1 database, be careful to load the output of