+ linkend="app-pgdump" endterm="app-pgdump-title"> for each database
+ in a cluster.
pg_dumpall also dumps
+ global objects that are common to all databases.
+ (
pg_dump does not save these objects.)
+ This currently includes the information about database users and
+ groups.
+
-
- -v
-
- Specifies verbose mode.
-
-
-
+ Thus,
pg_dumpall is an integrated
+ solution for backing up your databases.
+
-
- -x
-
- Prevent dumping ACLs (grant/revoke commands) and table ownership information.
-
-
-
+ Since
pg_dumpall reads tables from all
+ databases you will most likely have to connect as a database
+ superuser in order to produce a complete dump. Also you will need
+ superuser priviledges to execute the saves script in order to be
+ allowed to add users and groups, and to create databases.
+
-
- --accounts-only
-
- Only dump user and group information, nothing else.
-
-
-
+ The SQL script will be written to the standard ouput. Shell
+ operators should be used to redirect it into a file.
+
- >
- </para>
+ >
+ <title>Options>
-
pg_dumpall a
lso accepts
- the following command line arguments for connection parameters:
+
pg_dumpall a
ccepts the following
+ command line arguments:
- -h class="parameter">host
+ -h host
- Specifies the hostname of the machine on which the
- is running. If host begins with a slash, it is used
- as the directory for the unix domain socket.
+ Specifies the hostname of the machine on which the database
+ server is running. If host begins with a slash, it is used as
+ the directory for the Unix domain socket. The default is
+ taken from the PGHOST environment variable, if
+ set, else a Unix domain socket connection is attempted.
- -p class="parameter">port
+ -p port
- Specifies the Internet TCP/IP port or local Unix domain socket file
- extension on which the
postmaster
- is listening for connections. The port number defaults to 5432,
- or the value of the PGPORT
- environment variable (if set).
+ The port number on which the server is listening. Defaults to
+ the PGPORT environment variable, if set, or a
+ compiled-in default.
- -u
+ --globals-only
- Use password authentication.
- Prompts for
- username
- and password.
+ Only dump global objects (users and groups), no databases.
+
-
-
-
- 1998-10-04
-
-
- Outputs
-
-
pg_dumpall will create a file or
- write to stdout.
-
-
-
-
-Connection to database 'template1' failed.
-connectDBStart() -- connect() failed: No such file or directory
- Is the postmaster running locally
- and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
-
-
-
pg_dumpall could not attach to the
- process on the specified host and port. If you see this message,
- ensure that the
postmaster
- is running on the proper host and that you have specified the proper
- port. If your site uses an authentication system, ensure that you
- have obtained the required authentication credentials.
-
-
-
-
-
-
-Connection to database 'dbname' failed.
-FATAL 1: SetUserId: user 'username' is not in 'pg_shadow'
-
-
- You do not have a valid entry in the relation pg_shadow
- and and will not be allowed to access
Postgres.
- Contact your
Postgres administrator.
-
-
-
-
-
-
-dumpSequence(table): SELECT failed
-
-
- You do not have permission to read the database.
- Contact your
Postgres site administrator.
-
-
-
-
+ Any other command line parameters are passed to the underlying
+
+ calls. This is useful to control some aspects of the output
+ format, but some options such as ,
+
, and
+ class="parameter">dbname should be avoided.
-
-
-
pg_dumpall internally executes
- SELECT statements. If you have problems running
- make sure you are able to select information from the database using, for
-
-
- ynopsisdiv>
+ ect1>
-
-
- 1998-10-04
-
-
- Description
-
- is a utility for dumping out all Postgres databases into one file.
- It also dumps the pg_shadow table, which is global to all databases.
-
pg_dumpall includes in this file the proper commands
- to automatically create each dumped database before loading.
-
+
+
Usage
-
pg_dumpall takes all
pg_dump
- options, but , and
- dbname
- should be omitted.
+ To dump all databases:
+
+
+
+
- Refer to
-
- for more information on this capability.
+ To reload this database use, for example:
+
+
$ psql -f db.out template1
+
+ (It is not important to which database you connect here since the
+ script file created by
pg_dumpall will
+ contain the appropriate commands to create and connect to the saved
+ databases.
-
-
- 1998-10-04
-
-
- Usage
-
- To dump all databases:
+
+
See Also
-$ pg_dumpall > db.out
-
-
-
- You can use most
pg_dump options
-
-
-
- To reload this database:
-
-$ psql -e template1 < db.out
-
+
,
+ linkend="app-psql" endterm="app-psql-title">. Check there for
+ details on possible error conditions.
-
- You can use most
psql options
- when reloading.
-
-
-
+
+