1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
15 TITLE="PostgreSQL Client Applications"
16 HREF="reference-client.html"><LINK
19 HREF="app-pgdump.html"><LINK
22 HREF="app-pgrestore.html"><LINK
25 HREF="stylesheet.css"><META
27 CONTENT="2003-12-22T03:48:47"></HEAD
33 SUMMARY="Header navigation table"
43 >PostgreSQL 7.4.1 Documentation</TH
51 HREF="app-pgdump.html"
60 HREF="app-pgdump.html"
73 HREF="app-pgrestore.html"
81 HREF="app-pgrestore.html"
105 >pg_dumpall -- extract a <SPAN
108 > database cluster into a script file</DIV
113 CLASS="REFSYNOPSISDIV"
131 NAME="APP-PG-DUMPALL-DESCRIPTION"
139 > is a utility for writing out
147 of a cluster into one script file. The script file contains
151 > commands that can be used as input to <A
157 > to restore the databases. It does this by
159 HREF="app-pgdump.html"
161 > for each database in a cluster.
165 > also dumps global objects
166 that are common to all databases.
170 > does not save these objects.)
171 This currently includes information about database users and
172 groups, and access permissions that apply to databases as a whole.
179 solution for backing up your databases. But note a limitation:
182 >"large objects"</SPAN
187 > cannot dump such objects into
188 text files. If you have databases containing large objects,
189 they should be dumped using one of <SPAN
193 non-text output modes.
199 > reads tables from all
200 databases you will most likely have to connect as a database
201 superuser in order to produce a complete dump. Also you will need
202 superuser privileges to execute the saved script in order to be
203 allowed to add users and groups, and to create databases.
206 > The SQL script will be written to the standard output. Shell
207 operators should be used to redirect it into a file.
213 > needs to connect several
217 > server and might be asking for
218 a password each time. It is convenient to have a
222 > file in such cases.
233 > The following command-line options are used to control the content and
234 format of the output.
251 > Dump only the data, not the schema (data definitions).
264 > Include SQL commands to clean (drop) the databases before
285 >). This will make restoration very
286 slow, but it makes the output more portable to other SQL database
296 >--column-inserts</VAR
299 >--attribute-inserts</VAR
306 > commands with explicit
319 >). This will make restoration very slow,
320 but it is necessary if you desire to rearrange column ordering.
333 > Dump only global objects (users and groups), no databases.
342 >--ignore-version</VAR
346 > Ignore version mismatch between
350 > and the database server.
356 > can handle databases
357 from previous releases of <SPAN
361 old versions are not supported anymore (currently prior to
362 7.0). Use this option if you need to override the version
367 fails, don't say you weren't warned).
380 > Dump object identifiers (<ACRONYM
384 table. Use this option if your application references the OID
385 columns in some way (e.g., in a foreign key constraint).
386 Otherwise, this option should not be used.
399 > Dump only the schema (data definitions), no data.
412 > Specifies verbose mode. This will cause
417 messages to standard error.
426 >--no-privileges</VAR
433 > Prevent dumping of access privileges (grant/revoke commands).
441 > The following command-line options control the database connection parameters.
455 > Specifies the host name of the machine on which the database
456 server is running. If the value begins with a slash, it is
457 used as the directory for the Unix domain socket. The default
458 is taken from the <TT
461 > environment variable,
462 if set, else a Unix domain socket connection is attempted.
472 > Specifies the TCP port or local Unix domain socket file
473 extension on which the server is listening for connections.
477 > environment variable, if
478 set, or a compiled-in default.
488 > Connect as the given user.
495 > Force a password prompt. This should happen automatically if
496 the server requires password authentication.
529 > Default connection parameters
550 > internally, some diagnostic
551 messages will refer to <SPAN
557 > Once restored, it is wise to run <TT
561 database so the optimizer has useful statistics. You
572 NAME="APP-PG-DUMPALL-EX"
577 > To dump all databases:
586 >pg_dumpall > db.out</KBD
591 > To reload this database use, for example:
599 >psql -f db.out template1</KBD
602 (It is not important to which database you connect here since the
603 script file created by <SPAN
607 contain the appropriate commands to create and connect to the saved
620 HREF="app-pgdump.html"
622 >. Check there for details on possible
631 SUMMARY="Footer navigation table"
642 HREF="app-pgdump.html"
660 HREF="app-pgrestore.html"
676 HREF="reference-client.html"