pg_dump and pg_restore man pages need to mention that one should restore
authorTom Lane <[email protected]>
Mon, 11 Feb 2002 00:14:10 +0000 (00:14 +0000)
committerTom Lane <[email protected]>
Mon, 11 Feb 2002 00:14:10 +0000 (00:14 +0000)
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
doc/src/sgml/ref/pg_restore.sgml

index 51fd47f15211fcf59032c35e334d3aa33255061d..270b85cc717db2328b288e4fa31b5f2d610f94dd 100644 (file)
@@ -603,8 +603,21 @@ connectDBStart() -- connect() failed: No such file or directory
 
  <refsect1 id="pg-dump-notes">
   <title>Notes</title>
+
+  <para>
+   If your installation has any local additions to the template1 database,
+   be careful to restore the output of <command>pg_dump</command> 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:
+<programlisting>
+CREATE DATABASE foo WITH TEMPLATE = template0;
+</programlisting>
+  </para>
+
   <para>
-   <command>pg_dump</command> has a few limitations.
+   <command>pg_dump</command> has a few limitations:
 
    <itemizedlist>
     <listitem>
index d8954b7a36a207c9f135e9bbcb2c523a512bf0c9..444a6c203c1708a94463c02beca53dd670eb1329 100644 (file)
@@ -513,13 +513,25 @@ connectDBStart() -- connect() failed: No such file or directory
    Notes
   </title>
 
+  <para>
+   If your installation has any local additions to the template1 database,
+   be careful to load the output of <command>pg_restore</command> 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:
+<programlisting>
+CREATE DATABASE foo WITH TEMPLATE = template0;
+</programlisting>
+  </para>
+
   <para>
    The limitations of <command>pg_restore</command> are detailed below.
 
    <itemizedlist>
     <listitem>
      <para>
-      When restoring data to a table, <command>pg_restore</command> emits queries
+      When restoring data to a pre-existing table, <command>pg_restore</command> 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
 
   <para>
    See the <xref linkend="app-pgdump"> documentation for details on
-   limitation of <command>pg_dump</command>.
+   limitations of <command>pg_dump</command>.
   </para>
  </refsect1>