From 906254a53c7efee365ece567ddeab69ac9870d53 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 11 Feb 2002 00:14:10 +0000 Subject: [PATCH] pg_dump and pg_restore man pages need to mention that one should restore into a virgin database, ie, one created from template0, if there are any site-local additions in template1. --- doc/src/sgml/ref/pg_dump.sgml | 17 +++++++++++++++-- doc/src/sgml/ref/pg_restore.sgml | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 9aadae36e0..0169043e96 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1,5 +1,5 @@ @@ -603,8 +603,21 @@ connectDBStart() -- connect() failed: No such file or directory Notes + + + If your installation has any local additions to the template1 database, + be careful to restore the output of pg_dump into a + truly empty database; otherwise you are likely to get errors due to + duplicate definitions of the added objects. To make an empty database + without any local additions, copy from template0 not template1, + for example: + +CREATE DATABASE foo WITH TEMPLATE = template0; + + + - pg_dump has a few limitations. + pg_dump has a few limitations: diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index ef0587c11f..b88bb4ae74 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -1,4 +1,4 @@ - + @@ -513,13 +513,25 @@ connectDBStart() -- connect() failed: No such file or directory Notes + + If your installation has any local additions to the template1 database, + be careful to load the output of pg_restore into a + truly empty database; otherwise you are likely to get errors due to + duplicate definitions of the added objects. To make an empty database + without any local additions, copy from template0 not template1, + for example: + +CREATE DATABASE foo WITH TEMPLATE = template0; + + + The limitations of pg_restore are detailed below. - When restoring data to a table, pg_restore emits queries + When restoring data to a pre-existing table, pg_restore emits queries to disable triggers on user tables before inserting the data then emits queries to re-enable them after the data has been inserted. If the restore is stopped in the middle, the system catalogs may be left in the wrong state. @@ -538,7 +550,7 @@ connectDBStart() -- connect() failed: No such file or directory See the documentation for details on - limitation of pg_dump. + limitations of pg_dump. -- 2.40.0