2 $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dumpall.sgml,v 1.17 2000/12/19 22:12:46 petere Exp $
6 <refentry id="APP-PG-DUMPALL">
8 <date>2000-12-19</date>
12 <refentrytitle id="APP-PG-DUMPALL-TITLE"><application>pg_dumpall</application></refentrytitle>
13 <manvolnum>1</manvolnum>
14 <refmiscinfo>Application</refmiscinfo>
18 <refname>pg_dumpall</refname>
19 <refpurpose>Extract all databases into a script file</refpurpose>
24 <command>pg_dumpall</command>
25 <group><arg>-c</arg><arg>--clean</arg></group>
26 <arg>-h <replaceable>host</replaceable></arg>
27 <arg>-p <replaceable>port</replaceable></arg>
28 <arg>--globals-only</arg>
32 <refsect1 id="app-pg-dumpall-description">
33 <title>Description</title>
36 <application>pg_dumpall</application> is a utility for writing out
37 (<quote>dumping</quote>) all Postgres databases of a cluster into
38 one script file. The script file contains SQL commands that can be
39 used as input to <xref linkend="app-psql" endterm="app-psql-title">
40 to restore the databases. It does this by calling <xref
41 linkend="app-pgdump" endterm="app-pgdump-title"> for each database
42 in a cluster. <application>pg_dumpall</application> also dumps
43 global objects that are common to all databases.
44 (<application>pg_dump</application> does not save these objects.)
45 This currently includes the information about database users and
50 Thus, <application>pg_dumpall</application> is an integrated
51 solution for backing up your databases.
55 Since <application>pg_dumpall</application> reads tables from all
56 databases you will most likely have to connect as a database
57 superuser in order to produce a complete dump. Also you will need
58 superuser priviledges to execute the saves script in order to be
59 allowed to add users and groups, and to create databases.
63 The SQL script will be written to the standard ouput. Shell
64 operators should be used to redirect it into a file.
68 <title>Options</title>
71 <application>pg_dumpall</application> accepts the following
72 command line arguments:
76 <term>-h <replaceable>host</replaceable></term>
79 Specifies the hostname of the machine on which the database
80 server is running. If host begins with a slash, it is used as
81 the directory for the Unix domain socket. The default is
82 taken from the <envar>PGHOST</envar> environment variable, if
83 set, else a Unix domain socket connection is attempted.
89 <term>-p <replaceable>port</replaceable></term>
92 The port number on which the server is listening. Defaults to
93 the <envar>PGPORT</envar> environment variable, if set, or a
100 <term>--globals-only</term>
103 Only dump global objects (users and groups), no databases.
112 Any other command line parameters are passed to the underlying
113 <xref endterm="app-pgdump-title" linkend="app-pgdump-title">
114 calls. This is useful to control some aspects of the output
115 format, but some options such as <option>-f</option>,
116 <option>-t</option>, and <replaceable
117 class="parameter">dbname</replaceable> should be avoided.
122 <refsect1 id="app-pg-dumpall-usage">
125 To dump all databases:
128 <prompt>$</prompt> <userinput>pg_dumpall > db.out</userinput>
133 To reload this database use, for example:
135 <prompt>$</prompt> <userinput>psql -f db.out template1</userinput>
137 (It is not important to which database you connect here since the
138 script file created by <application>pg_dumpall</application> will
139 contain the appropriate commands to create and connect to the saved
145 <title>See Also</title>
148 <xref linkend="app-pgdump" endterm="app-pgdump-title">, <xref
149 linkend="app-psql" endterm="app-psql-title">. Check there for
150 details on possible error conditions.
156 <!-- Keep this comment at the end of the file
161 sgml-minimize-attributes:nil
162 sgml-always-quote-attributes:t
165 sgml-parent-document:nil
166 sgml-default-dtd-file:"../reference.ced"
167 sgml-exposed-tags:nil
168 sgml-local-catalogs:"/usr/lib/sgml/catalog"
169 sgml-local-ecat-files:nil