1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
<!-- manual page source format generated by PolyglotMan v3.0.4, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>PG_DUMP(UNIX) manual page</TITLE>
</HEAD>
<BODY>
<A HREF="pgsql.html">PostgreSQL Contents</A>
<H2><A NAME="sect0" HREF="#toc0">NAME </A></H2>
pg_dump - dumps out a Postgres database into a script file
<H2><A NAME="sect1" HREF="#toc1">SYNOPSIS
</A></H2>
<B>pg_dump</B> [<B>-a</B> ] [<B>-d</B> ] [<B>-D</B> ] [<B>-f</B> filename ] [<B>-h</B> hostname ] [<B>-o</B> ] [<B>-p</B> port] [<B>-s</B> ]
[<B>-t</B> table] [<B>-v</B> ] [<B>-u</B>] dbname
<H2><A NAME="sect2" HREF="#toc2">DESCRIPTION </A></H2>
<I>pg_dump</I> is a utility for dumping
out a Postgres database into a script file containing query commands.
The script files are in a ASCII format and can be used to reconstruct
the database, even on other machines and other architectures. <I>pg_dump</I>
will produce the queries necessary to re-generate all user-defined types,
functions, tables, indices, aggregates, and operators. In addition, all
the data is copied out in ASCII format so that it can be readily copied
in again, as well, as imported into tools for textual editing. <P>
<I>pg_dump</I>
is useful for dumping out the contents of a database to move from one
postgreSQL installation to another. After running <I>pg_dump</I> , one should
examine the output script file for any warnings, especially in light of
the limitations listed below. <P>
pg_dump understands the following options:
<DL>
<DT><B>-a</B> </DT>
<DD>Dump out only the data, no schema </DD>
<DT><B>-d</B> </DT>
<DD>Dump data as proper insert strings
</DD>
<DT><B>-D</B> </DT>
<DD>Dump data as inserts with attribute names </DD>
<DT><B>-f</B> filename </DT>
<DD>Specifies the
output file </DD>
<DT><B>-h</B> hostname </DT>
<DD>Specifies the server host name </DD>
<DT><B>-o</B> </DT>
<DD>Dump object
id's (oids) </DD>
<DT><B>-p</B> port </DT>
<DD>Specifies the server port number </DD>
<DT><B>-s</B> </DT>
<DD>Dump out only the
schema, no data </DD>
<DT><B>-t</B> table </DT>
<DD>Dump for this table only </DD>
<DT><B>-u</B> </DT>
<DD>Use password authentication.
Prompts for username and password. </DD>
<DT><B>-v</B> </DT>
<DD>Specifies verbose mode </DD>
</DL>
<P>
If dbname
is not supplied, then the DATABASE environment variable value is used.
<H2><A NAME="sect3" HREF="#toc3">CAVEATS AND LIMITATIONS </A></H2>
<I>pg_dump</I> has a few limitations. The limitations
mostly stem from difficulty in extracting certain meta-information from
the system catalogs.
<DL>
<DT><B>rules and views</B> </DT>
<DD>pg_dump does not understand user-defined
rules and views and will fail to dump them properly. (This is due to the
fact that rules are stored as plans in the catalogs and not textually)
</DD>
<DT><B>partial indices</B> </DT>
<DD>pg_dump does not understand partial indices. (The reason
is the same as above. Partial index predicates are stored as plans) </DD>
<DT><B>large
objects</B> </DT>
<DD>pg_dump does not handle large objects. Large objects are ignored
and must be dealt with manually. </DD>
</DL>
<H2><A NAME="sect4" HREF="#toc4">EXAMPLES </A></H2>
To dump a database: <BR>
<P>
<tt> </tt><tt> </tt>pg_dump
>db.out <BR>
<P>
To reload it: <BR>
<P>
<tt> </tt><tt> </tt>psql -e database <db.out <BR>
<P>
<H2><A NAME="sect5" HREF="#toc5">SEE ALSO </A></H2>
<A HREF="copy.l.html">copy(l)</A>
<P>
<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">NAME</A></LI>
<LI><A NAME="toc1" HREF="#sect1">SYNOPSIS</A></LI>
<LI><A NAME="toc2" HREF="#sect2">DESCRIPTION</A></LI>
<LI><A NAME="toc3" HREF="#sect3">CAVEATS AND LIMITATIONS</A></LI>
<LI><A NAME="toc4" HREF="#sect4">EXAMPLES</A></LI>
<LI><A NAME="toc5" HREF="#sect5">SEE ALSO</A></LI>
</UL>
</BODY></HTML>
|