MAN page from Old RedHat 5.X postgresql-clients-6.3.2-10.i386.rpm
PG_DUMP
Section: PostgreSQL (UNIX)
Updated: 1/20/96
Index NAME
pg_dump - dumps out a Postgres database into a script file
SYNOPSIS
pg_dump[
-a][
-d][
-D][
-ffilename][
-hhostname][
-o][
-pport][
-s][
-ttable][
-v][
-u]dbname
DESCRIPTION
pg_dumpis a utility for dumping out a Postgres database into a script file containing query commands. The scriptfiles are in a ASCII format and can be used to reconstruct the database,even on other machines and other architectures.
pg_dumpwill produce the queries necessary to re-generate alluser-defined types, functions, tables, indices, aggregates, andoperators. In addition, all the data is copied out in ASCII format sothat it can be readily copied in again, as well, as imported into toolsfor textual editing.
pg_dumpis useful for dumping out the contents of a database to move from onepostgreSQL installation to another. After running pg_dump, one should examine the output script file for any warnings, especiallyin light of the limitations listed below.
pg_dump understands the following options:
- -a
- Dump out only the data, no schema
- -d
- Dump data as proper insert strings
- -D
- Dump data as inserts with attribute names
- -f filename
- Specifies the output file
- -h hostname
- Specifies the server host name
- -o
- Dump object id's (oids)
- -p port
- Specifies the server port number
- -s
- Dump out only the schema, no data
- -t table
- Dump for this table only
- -u
- Use password authentication. Prompts for username and password.
- -v
- Specifies verbose mode
If dbname is not supplied, then the DATABASE environment variable value is used.
CAVEATS AND LIMITATIONS
pg_dumphas a few limitations.The limitations mostly stem fromdifficulty in extracting certain meta-information from the systemcatalogs.
- rules and views
- pg_dump does not understand user-defined rules and views andwill fail to dump them properly. (This is due to the fact thatrules are stored as plans in the catalogs and not textually)
- partial indices
- pg_dump does not understand partial indices. (The reason isthe same as above. Partial index predicates are stored as plans)
- large objects
- pg_dump does not handle large objects. Large objects are ignored andmust be dealt with manually.
EXAMPLES
To dump a database: pg_dump >db.outTo reload it: psql -e database <db.out
SEE ALSO
copy(l)
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- CAVEATS AND LIMITATIONS
- EXAMPLES
- SEE ALSO
This document was created byman2html,using the manual pages.