]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/pg_dumpall.sgml
Add mention of hostname leading slash handling to all manual pages that use -h.
[postgresql] / doc / src / sgml / ref / pg_dumpall.sgml
1 <!--
2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.14 2000/11/13 23:57:20 momjian Exp $
3 Postgres documentation
4 -->
5
6 <refentry id="APP-PGDUMPALL">
7  <refmeta>
8   <refentrytitle id="APP-PGDUMPALL-TITLE">
9    <application>pg_dumpall</application>
10   </refentrytitle>
11   <refmiscinfo>Application</refmiscinfo>
12  </refmeta>
13  <refnamediv>
14   <refname>
15    <application>pg_dumpall</application>
16   </refname>
17   <refpurpose>
18    Extract all <productname>Postgres</productname> databases into a script file
19   </refpurpose>
20  </refnamediv>
21  <refsynopsisdiv>
22   <refsynopsisdivinfo>
23    <date>1999-07-20</date>
24   </refsynopsisdivinfo>
25   <synopsis>
26 pg_dumpall [ -h <replaceable class="parameter">host</replaceable> ] [ -p <replaceable class="parameter">port</replaceable> ] [ -a ] [ -d ] [ -D ] [ -O ] [ -s ] [ -u ] [ -v ] [ -x ] [ --accounts-only ]
27   </synopsis>
28
29   <refsect2 id="R2-APP-PG-DUMPALL-1">
30    <refsect2info>
31     <date>1998-10-04</date>
32    </refsect2info>
33    <title>
34     Inputs
35    </title>
36    <para>
37     <application>pg_dumpall</application> accepts the following command line arguments:
38
39     <variablelist>
40      <varlistentry>
41       <term>-a</term>
42       <listitem>
43        <para>
44         Dump out only the data, no schema (definitions).
45        </para>
46       </listitem>
47      </varlistentry>
48
49      <varlistentry>
50       <term>-d</term>
51       <listitem>
52        <para>
53         Dump data as proper insert strings.
54        </para>
55       </listitem>
56      </varlistentry>
57
58      <varlistentry>
59       <term>-D</term>
60       <listitem>
61        <para>
62         Dump data as inserts with attribute names
63        </para>
64       </listitem>
65      </varlistentry>
66
67      <varlistentry>
68       <term>-n</term>
69       <listitem>
70        <para>
71         Suppress double quotes around identifiers unless absolutely necessary.
72         This may cause trouble loading this dumped data if there are reserved words
73         used for identifiers.
74        </para>
75       </listitem>
76      </varlistentry>
77
78      <varlistentry>
79       <term>-o</term>
80       <listitem>
81        <para>
82         Dump object identifiers (<acronym>OID</acronym>s) for every table.
83        </para>
84       </listitem>
85      </varlistentry>
86
87      <varlistentry>
88       <term>-s</term>
89       <listitem>
90        <para>
91         Dump out only the schema (definitions), no data.
92        </para>
93       </listitem>
94      </varlistentry>
95
96      <varlistentry>
97       <term>-u</term>
98       <listitem>
99        <para>
100         Use password authentication. Prompts for username and password.
101        </para>
102       </listitem>
103      </varlistentry>
104
105      <varlistentry>
106       <term>-v</term>
107       <listitem>
108        <para>
109         Specifies verbose mode.
110        </para>
111       </listitem>
112      </varlistentry>
113
114      <varlistentry>
115       <term>-x</term>
116       <listitem>
117        <para>
118         Prevent dumping ACLs (grant/revoke commands) and table ownership information.
119        </para>
120       </listitem>
121      </varlistentry>
122
123      <varlistentry>
124       <term>--accounts-only</term>
125       <listitem>
126        <para>
127         Only dump user and group information, nothing else.
128        </para>
129       </listitem>
130      </varlistentry>
131
132     </variablelist>
133    </para>
134
135    <para>
136     <application>pg_dumpall</application> also accepts 
137     the following command line arguments for connection parameters:
138
139     <variablelist>
140      <varlistentry>
141       <term>-h <replaceable class="parameter">host</replaceable></term>
142       <listitem>
143        <para>
144         Specifies the hostname of the machine on which the 
145         <application>postmaster</application>
146         is running.  If host begins with a slash, it is used 
147         as the path to a unix domain socket.
148        </para>
149       </listitem>
150      </varlistentry>
151
152      <varlistentry>
153       <term>-p <replaceable class="parameter">port</replaceable></term>
154       <listitem>
155        <para>
156         Specifies the Internet TCP/IP port or local Unix domain socket file 
157         extension on which the <application>postmaster</application>
158         is listening for connections.  The port number defaults to 5432,
159         or the value of the <envar>PGPORT</envar>
160         environment variable (if set).
161        </para>
162       </listitem>
163      </varlistentry>
164
165      <varlistentry>
166       <term>-u</term>
167       <listitem>
168        <para>
169         Use password authentication. 
170         Prompts for
171         <replaceable class="parameter">username</replaceable>
172         and <replaceable class="parameter">password</replaceable>.
173        </para>
174       </listitem>
175      </varlistentry>
176     </variablelist>
177    </para>
178   </refsect2>
179
180   <refsect2 id="R2-APP-PG-DUMPALL-2">
181    <refsect2info>
182     <date>1998-10-04</date>
183    </refsect2info>
184    <title>
185     Outputs
186    </title>
187    <para>
188     <application>pg_dumpall</application> will create a file or
189     write to <filename>stdout</filename>.
190
191     <variablelist>
192      <varlistentry>
193       <term><computeroutput>
194 Connection to database 'template1' failed.
195 connectDB() failed: Is the postmaster running and accepting connections at 'UNIX Socket' on port '<replaceable class="parameter">port</replaceable>'?
196        </computeroutput></term>
197       <listitem>
198        <para>
199         <application>pg_dumpall</application> could not attach to the 
200         <application>postmaster</application> 
201         process on the specified host and port.  If you see this message,
202         ensure that the <application>postmaster</application> 
203         is running on the proper host and that you have specified the proper
204         port.  If your site uses an authentication system, ensure that you
205         have obtained the required authentication credentials.
206        </para>
207       </listitem>
208      </varlistentry>
209
210      <varlistentry>
211       <term><computeroutput>
212 Connection to database '<replaceable class="parameter">dbname</replaceable>' failed.
213 FATAL 1:  SetUserId: user '<replaceable class="parameter">username</replaceable>' is not in 'pg_shadow'
214        </computeroutput></term>
215       <listitem>
216        <para>
217         You do not have a valid entry in the relation <literal>pg_shadow</literal>
218         and and will not be allowed to access <productname>Postgres</productname>. 
219         Contact your <productname>Postgres</productname> administrator.
220        </para>
221       </listitem>
222      </varlistentry>
223
224      <varlistentry>
225       <term><computeroutput>
226 dumpSequence(<replaceable class="parameter">table</replaceable>): SELECT failed
227        </computeroutput></term>
228       <listitem>
229        <para>
230         You do not have permission to read the database.
231         Contact your <productname>Postgres</productname> site administrator.
232        </para>
233       </listitem>
234      </varlistentry>
235     </variablelist>
236    </para>
237
238    <note>
239     <para>
240      <application>pg_dumpall</application> internally executes
241      <command>SELECT</command> statements. If you have problems running
242      <application>pg_dumpall</application>,
243      make sure you are able to select information from the database using, for
244      example, <application>psql</application>.
245     </para>
246    </note>
247   </refsect2>
248  </refsynopsisdiv>
249
250  <refsect1 id="R1-APP-PG-DUMPALL-1">
251   <refsect1info>
252    <date>1998-10-04</date>
253   </refsect1info>
254   <title>
255    Description
256   </title>
257   <para>
258    <application>pg_dumpall</application>
259    is a utility for dumping out all Postgres databases into one file.
260    It also dumps the pg_shadow table, which is global to all databases.
261    <application>pg_dumpall</application> includes in this file the proper commands
262    to automatically create each dumped database before loading.
263   </para>
264   <para>
265    <application>pg_dumpall</application> takes all <application>pg_dump</application>
266    options, but <option>-f</option>, <option>-t</option> and 
267    <replaceable class="parameter">dbname</replaceable>
268    should be omitted.
269   </para>
270   <para>
271    Refer to 
272    <xref endterm="app-pgdump-title" linkend="app-pgdump-title">
273    for more information on this capability.
274   </para>
275  </refsect1>
276
277  <refsect1 id="R1-APP-PG-DUMPALL-2">
278   <refsect1info>
279    <date>1998-10-04</date>
280   </refsect1info>
281   <title>
282    Usage
283   </title>
284   <para>
285    To dump all databases:
286
287    <programlisting>
288 $ pg_dumpall > db.out
289    </programlisting>
290
291    <tip>
292     <para>
293      You can use most <application>pg_dump</application> options
294      for <application>pg_dumpall</application>.
295     </para>
296    </tip>
297   </para>
298   <para>
299    To reload this database:
300
301    <programlisting>
302 $ psql -e template1 < db.out
303    </programlisting>
304   </para>
305   <tip>
306    <para>
307     You can use most <application>psql</application> options
308     when reloading.
309    </para>
310   </tip>
311  </refsect1>
312 </refentry>
313
314 <!-- Keep this comment at the end of the file
315 Local variables:
316 mode: sgml
317 sgml-omittag:nil
318 sgml-shorttag:t
319 sgml-minimize-attributes:nil
320 sgml-always-quote-attributes:t
321 sgml-indent-step:1
322 sgml-indent-data:t
323 sgml-parent-document:nil
324 sgml-default-dtd-file:"../reference.ced"
325 sgml-exposed-tags:nil
326 sgml-local-catalogs:"/usr/lib/sgml/catalog"
327 sgml-local-ecat-files:nil
328 End:
329 -->