@@ -106,22 +106,28 @@ pg_dump <replaceable class="parameter">dbname</replaceable> > <replaceable cl
106106
107107 <para>
108108 Text files created by <application>pg_dump</application> are intended to
109- be read in by the <application>psql</application> program. The
110- general command form to restore a dump is
109+ be read by the <application>psql</application> program using its default
110+ settings. The general command form to restore a text dump is
111111<synopsis>
112- psql <replaceable class="parameter">dbname</replaceable> < <replaceable class="parameter">dumpfile</replaceable>
112+ psql -X <replaceable class="parameter">dbname</replaceable> < <replaceable class="parameter">dumpfile</replaceable>
113113</synopsis>
114114 where <replaceable class="parameter">dumpfile</replaceable> is the
115115 file output by the <application>pg_dump</application> command. The database <replaceable
116116 class="parameter">dbname</replaceable> will not be created by this
117117 command, so you must create it yourself from <literal>template0</literal>
118118 before executing <application>psql</application> (e.g., with
119119 <literal>createdb -T template0 <replaceable
120- class="parameter">dbname</replaceable></literal>). <application>psql</application>
120+ class="parameter">dbname</replaceable></literal>).
121+ To ensure <application>psql</application> runs with its default settings,
122+ use the <option>-X</option> (<option>--no-psqlrc</option>) option.
123+ <application>psql</application>
121124 supports options similar to <application>pg_dump</application> for specifying
122125 the database server to connect to and the user name to use. See
123126 the <xref linkend="app-psql"/> reference page for more information.
124- Non-text file dumps are restored using the <xref
127+ </para>
128+
129+ <para>
130+ Non-text file dumps should be restored using the <xref
125131 linkend="app-pgrestore"/> utility.
126132 </para>
127133
@@ -141,7 +147,7 @@ psql <replaceable class="parameter">dbname</replaceable> < <replaceable class
141147 behavior and have <application>psql</application> exit with an
142148 exit status of 3 if an SQL error occurs:
143149<programlisting>
144- psql --set ON_ERROR_STOP=on <replaceable>dbname</replaceable> < <replaceable>dumpfile</replaceable>
150+ psql -X - -set ON_ERROR_STOP=on <replaceable>dbname</replaceable> < <replaceable>dumpfile</replaceable>
145151</programlisting>
146152 Either way, you will only have a partially restored database.
147153 Alternatively, you can specify that the whole dump should be
@@ -160,7 +166,7 @@ psql --set ON_ERROR_STOP=on <replaceable>dbname</replaceable> < <replaceable>
160166 write to or read from pipes makes it possible to dump a database
161167 directly from one server to another, for example:
162168<programlisting>
163- pg_dump -h <replaceable>host1</replaceable> <replaceable>dbname</replaceable> | psql -h <replaceable>host2</replaceable> <replaceable>dbname</replaceable>
169+ pg_dump -h <replaceable>host1</replaceable> <replaceable>dbname</replaceable> | psql -X - h <replaceable>host2</replaceable> <replaceable>dbname</replaceable>
164170</programlisting>
165171 </para>
166172
@@ -205,7 +211,7 @@ pg_dumpall > <replaceable>dumpfile</replaceable>
205211</synopsis>
206212 The resulting dump can be restored with <application>psql</application>:
207213<synopsis>
208- psql -f <replaceable class="parameter">dumpfile</replaceable> postgres
214+ psql -X - f <replaceable class="parameter">dumpfile</replaceable> postgres
209215</synopsis>
210216 (Actually, you can specify any existing database name to start from,
211217 but if you are loading into an empty cluster then <literal>postgres</literal>
0 commit comments