<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.27 2000/12/25 23:15:26 petere Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.28 2001/03/05 18:42:56 momjian Exp $
Postgres documentation
-->
pg_dump [ <replaceable class="parameter">dbname</replaceable> ]
pg_dump [ -h <replaceable class="parameter">host</replaceable> ]
[ -p <replaceable class="parameter">port</replaceable> ]
- [ -t <replaceable class="parameter">table</replaceable> ]\r
- [ -a ] [ -b ] [ -c ] [-C] [ -d ] [ -D ] \r
- [-f <REPLACEABLE CLASS="PARAMETER">file</REPLACEABLE>] \r
- [-F <REPLACEABLE CLASS="PARAMETER">format</REPLACEABLE>] \r
- [ -i ] [ -n ] [ -N ] [ -o ] [ -O ] [-R] \r
- [ -s ] [ -S ] [ -u ] [ -v ] [ -x ] [ -Z 0..9 ] \r
+ [ -t <replaceable class="parameter">table</replaceable> ]
+ [ -a ] [ -b ] [ -c ] [-C] [ -d ] [ -D ]
+ [-f <REPLACEABLE CLASS="PARAMETER">file</REPLACEABLE>]
+ [-F <REPLACEABLE CLASS="PARAMETER">format</REPLACEABLE>]
+ [ -i ] [ -n ] [ -N ] [ -o ] [ -O ] [-R]
+ [ -s ] [ -S ] [ -u ] [ -v ] [ -x ] [ -Z 0..9 ]
[ <replaceable class="parameter">dbname</replaceable> ]
</synopsis>
</listitem>
</varlistentry>
- <varlistentry>\r
- <term>-b</term>\r
- <listitem>\r
- <para>\r
- Dump BLOB data.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-c</term>\r
- <listitem>\r
- <para>\r
- Clean (drop) schema prior to create.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-C</term>\r
- <listitem>\r
- <para>\r
- For plain text (script) output, include SQL to create the database itself.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
+ <varlistentry>
+ <term>-b</term>
+ <listitem>
+ <para>
+ Dump data and BLOB data.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-c</term>
+ <listitem>
+ <para>
+ Clean (drop) schema prior to create.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-C</term>
+ <listitem>
+ <para>
+ For plain text (script) output, include SQL to create the database itself.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>-d</term>
<listitem>
<para>
- Dump data as proper insert strings. This is not recommended for large databases\r
+ Dump data as proper insert strings. This is not recommended for large databases
for performance reasons.
</para>
</listitem>
<term>-D</term>
<listitem>
<para>
- Dump data as inserts with attribute names. This is not recommended for large databases\r
+ Dump data as inserts with attribute names. This is not recommended for large databases
for performance reasons.
</para>
</listitem>
</varlistentry>
-\r
- <varlistentry>\r
- <term>-f <replaceable class="parameter">file</replaceable></term>\r
- <listitem>\r
- <para>\r
- Send output to the specified file.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-F <replaceable class="parameter">format</replaceable></term>\r
- <listitem>\r
- <para>\r
- Format can be one of the following:\r
- </para>\r
-\r
-\r
- <variablelist>\r
- <varlistentry>\r
- <term>p</term>\r
- <listitem>\r
- <para>\r
- output a plain text SQL script file (default)\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>t</term>\r
- <listitem>\r
- <para>\r
- output a TAR archive suitable for input into \r
- <APPLICATION>pg_restore</APPLICATION>. Using this archive format \r
- allows reordering and/or exclusion of schema elements \r
- at the time the database is restored. It is also possible to limit \r
- which data is reloaded at restore time.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>c</term>\r
- <listitem>\r
- <para>\r
- output a custom archive suitable for input into \r
- <APPLICATION>pg_restore</APPLICATION>. This is the most flexible \r
- format in that it allows reordering of data load as well \r
- as schema elements. This format is also compressed by default.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- </variablelist>\r
-\r
- </listitem>\r
- </varlistentry>\r
+
+ <varlistentry>
+ <term>-f <replaceable class="parameter">file</replaceable></term>
+ <listitem>
+ <para>
+ Send output to the specified file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-F <replaceable class="parameter">format</replaceable></term>
+ <listitem>
+ <para>
+ Format can be one of the following:
+ </para>
+
+
+ <variablelist>
+ <varlistentry>
+ <term>p</term>
+ <listitem>
+ <para>
+ output a plain text SQL script file (default)
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>t</term>
+ <listitem>
+ <para>
+ output a TAR archive suitable for input into
+ <APPLICATION>pg_restore</APPLICATION>. Using this archive format
+ allows reordering and/or exclusion of schema elements
+ at the time the database is restored. It is also possible to limit
+ which data is reloaded at restore time.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>c</term>
+ <listitem>
+ <para>
+ output a custom archive suitable for input into
+ <APPLICATION>pg_restore</APPLICATION>. This is the most flexible
+ format in that it allows reordering of data load as well
+ as schema elements. This format is also compressed by default.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ </listitem>
+ </varlistentry>
<varlistentry>
<term>-i</term>
</listitem>
</varlistentry>
- <varlistentry>\r
- <term>-o</term>\r
- <listitem>\r
- <para>\r
- Dump object identifiers (<acronym>OID</acronym>s) for every table.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-O</term>\r
- <listitem>\r
- <para>\r
- In plain text output mode, don't set object ownership to match the \r
- original database. Typically, <APPLICATION>pg_dump</APPLICATION> \r
- issues <PROGRAMLISTING>\connect</PROGRAMLISTING> statments to set \r
- ownership of schema elements.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-R</term>\r
- <listitem>\r
- <para>\r
- In plain text output mode, prohibit <APPLICATION>pg_dump</APPLICATION> \r
- from issuing any <PROGRAMLISTING>\connect</PROGRAMLISTING> statements.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
+ <varlistentry>
+ <term>-o</term>
+ <listitem>
+ <para>
+ Dump object identifiers (<acronym>OID</acronym>s) for every table.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-O</term>
+ <listitem>
+ <para>
+ In plain text output mode, don't set object ownership to match the
+ original database. Typically, <APPLICATION>pg_dump</APPLICATION>
+ issues <PROGRAMLISTING>\connect</PROGRAMLISTING> statments to set
+ ownership of schema elements.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-R</term>
+ <listitem>
+ <para>
+ In plain text output mode, prohibit <APPLICATION>pg_dump</APPLICATION>
+ from issuing any <PROGRAMLISTING>\connect</PROGRAMLISTING> statements.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>-s</term>
<listitem>
</listitem>
</varlistentry>
- <varlistentry>\r
- <term>-S <replaceable class="parameter">username</replaceable></term>\r
- <listitem>\r
- <para>\r
- Specify the superuser username to use when disabling triggers and/or \r
- setting ownership of schema elements.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
- <varlistentry>\r
- <term>-t <replaceable class="parameter">table</replaceable></term>\r
- <listitem>\r
- <para>\r
- Dump data for <replaceable class="parameter">table</replaceable> only.\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
+ <varlistentry>
+ <term>-S <replaceable class="parameter">username</replaceable></term>
+ <listitem>
+ <para>
+ Specify the superuser username to use when disabling triggers and/or
+ setting ownership of schema elements.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>-t <replaceable class="parameter">table</replaceable></term>
+ <listitem>
+ <para>
+ Dump data for <replaceable class="parameter">table</replaceable> only.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term>-u</term>
<listitem>
</para>
</listitem>
</varlistentry>
-\r
- <varlistentry>\r
- <term>-Z <replaceable class="parameter">0..9</replaceable></term>\r
- <listitem>\r
- <para>\r
- Specify the compression level to use in archive formats that support \r
- compression (currently only the custom archive format supports compression).\r
- </para>\r
- </listitem>\r
- </varlistentry>\r
-\r
+
+ <varlistentry>
+ <term>-Z <replaceable class="parameter">0..9</replaceable></term>
+ <listitem>
+ <para>
+ Specify the compression level to use in archive formats that support
+ compression (currently only the custom archive format supports compression).
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</para>
</title>
<para>
<application>pg_dump</application> is a utility for dumping out a
- <productname>Postgres</productname> database into a script or archive \r
- file containing query commands. The script files are in text format \r
- and can be used to reconstruct the database, even on other machines \r
- and other architectures.\r
- </para>\r
+ <productname>Postgres</productname> database into a script or archive
+ file containing query commands. The script files are in text format
+ and can be used to reconstruct the database, even on other machines
+ and other architectures.
+ </para>
<para>
- The archive files, new with version 7.1, contain enough information for \r
- <APPLICATION>pg_restore</APPLICATION> to rebuild the database, but also\r
- allow pg_restore to be selective about what is restored, or even to \r
- reorder the items prior to being restored. The archive files should \r
- also be portable across architectures.\r
- </para>\r
- <para>\r
+ The archive files, new with version 7.1, contain enough information for
+ <APPLICATION>pg_restore</APPLICATION> to rebuild the database, but also
+ allow pg_restore to be selective about what is restored, or even to
+ reorder the items prior to being restored. The archive files should
+ also be portable across architectures.
+ </para>
+ <para>
<application>pg_dump</application>
will produce the queries necessary to re-generate all
user-defined types, functions, tables, indices, aggregates, and
one should examine the output for any warnings, especially
in light of the limitations listed below.
</para>
-\r
- <para>\r
- When used with one of the alternate file formats and combined with \r
- <APPLICATION>pg_restore</APPLICATION>, it provides a flexible archival \r
- and trasfer mechanism. <APPLICATION>pg_dump</APPLICATION> can be used \r
- to backup an entire database, then <APPLICATION>pg_restore</APPLICATION> \r
- can be used to examine the archive and/or select which parts of the \r
- database are to be restored.\r
- </para>\r
-\r
- <para>\r
- See the <APPLICATION>pg_restore</APPLICATION> documentation for details.\r
- </para>\r
-\r
+
+ <para>
+ When used with one of the alternate file formats and combined with
+ <APPLICATION>pg_restore</APPLICATION>, it provides a flexible archival
+ and trasfer mechanism. <APPLICATION>pg_dump</APPLICATION> can be used
+ to backup an entire database, then <APPLICATION>pg_restore</APPLICATION>
+ can be used to examine the archive and/or select which parts of the
+ database are to be restored.
+ </para>
+
+ <para>
+ See the <APPLICATION>pg_restore</APPLICATION> documentation for details.
+ </para>
+
</refsect1>
<refsect1 id="R1-APP-PG-DUMP-2">
<listitem>
<para>
- When dumping a single table or as plain text, <application>pg_dump</application> \r
- does not handle large objects. Large objects must be dumped in their\r
- entirity using one of the binary archive formats.\r
+ When dumping a single table or as plain text, <application>pg_dump</application>
+ does not handle large objects. Large objects must be dumped in their
+ entirity using one of the binary archive formats.
</para>
</listitem>
$ psql -e database < db.out
</programlisting>
</para>
-\r
- <para>\r
- To dump a database called mydb that contains BLOBs to a TAR file:\r
-\r
- <programlisting>\r
-$ pg_dump -Ft --blobs mydb > db.tar\r
- </programlisting>\r
- </para>\r
-\r
- <para>\r
- To reload this database (with BLOBs) to an existing db called newdb:\r
-\r
- <programlisting>\r
-$ pg_restore db.tar --db=newdb\r
- </programlisting>\r
- </para>\r
-\r
+
+ <para>
+ To dump a database called mydb that contains BLOBs to a TAR file:
+
+ <programlisting>
+$ pg_dump -Ft --blobs mydb > db.tar
+ </programlisting>
+ </para>
+
+ <para>
+ To reload this database (with BLOBs) to an existing db called newdb:
+
+ <programlisting>
+$ pg_restore db.tar --db=newdb
+ </programlisting>
+ </para>
+
</refsect1>
</refentry>