1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.37 2001/09/21 21:58:29 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/ref/pg_dump.sgml,v 1.38 2001/10/23 22:11:22 tgl Exp $
3
3
Postgres documentation
4
4
-->
5
5
@@ -64,7 +64,7 @@ Postgres documentation
64
64
<productname>PostgreSQL</productname> database into a script or an
65
65
archive file. The script files are in plain text format and
66
66
contain the SQL commands required to reconstruct the database to
67
- the state it was in at the time is was saved. They can be used to
67
+ the state it was in at the time it was saved. They can be used to
68
68
reconstruct the database even on other machines and other
69
69
architectures, with some modifications even on other RDBMS
70
70
products. The alternative archive file formats are meant to be
@@ -91,12 +91,19 @@ Postgres documentation
91
91
92
92
<para>
93
93
When used with one of the archive file formats and combined with
94
- <command>pg_restore</command>, it provides a flexible archival and
94
+ <xref linkend="app-pgrestore">, <command>pg_dump</command> provides a
95
+ flexible archival and
95
96
transfer mechanism. <command>pg_dump</command> can be used to
96
97
backup an entire database, then <command>pg_restore</command> can
97
98
be used to examine the archive and/or select which parts of the
98
- database are to be restored. See the <xref
99
- linkend="app-pgrestore"> documentation for details.
99
+ database are to be restored.
100
+ The most flexible output file format is the <quote>custom</quote>
101
+ format (<option>-Fc</option>). It allows for selection and
102
+ reordering of all archived items, and is compressed by default. The
103
+ <filename>tar</filename> format (<option>-Ft</option>) is not
104
+ compressed and it is not possible to reorder data when loading, but
105
+ it is otherwise quite flexible; moreover, it can be manipulated with
106
+ other tools such as <filename>tar</filename>.
100
107
</para>
101
108
102
109
<para>
@@ -124,7 +131,7 @@ Postgres documentation
124
131
<term><replaceable class="parameter">dbname</replaceable></term>
125
132
<listitem>
126
133
<para>
127
- Specifies the name of the database to be extracted .
134
+ Specifies the name of the database to be dumped .
128
135
</para>
129
136
</listitem>
130
137
</varlistentry>
@@ -136,6 +143,12 @@ Postgres documentation
136
143
<para>
137
144
Dump only the data, not the schema (data definitions).
138
145
</para>
146
+
147
+ <para>
148
+ This option is only meaningful for the plain text format. For
149
+ the other formats, you may specify the option when you
150
+ call <command>pg_restore</command>.
151
+ </para>
139
152
</listitem>
140
153
</varlistentry>
141
154
@@ -154,8 +167,14 @@ Postgres documentation
154
167
<term>--clean</term>
155
168
<listitem>
156
169
<para>
157
- Output commands to clean (drop) the schema prior to (the
158
- commands for) creating it.
170
+ Output commands to clean (drop)
171
+ database objects prior to (the commands for) creating them.
172
+ </para>
173
+
174
+ <para>
175
+ This option is only meaningful for the plain text format. For
176
+ the other formats, you may specify the option when you
177
+ call <command>pg_restore</command>.
159
178
</para>
160
179
</listitem>
161
180
</varlistentry>
@@ -165,7 +184,16 @@ Postgres documentation
165
184
<term>--create</term>
166
185
<listitem>
167
186
<para>
168
- For plain text (script) output, include commands to create the database itself.
187
+ Begin the output with a command to create the
188
+ database itself and reconnect to the created database. (With a
189
+ script of this form, it doesn't matter which database you connect
190
+ to before running the script.)
191
+ </para>
192
+
193
+ <para>
194
+ This option is only meaningful for the plain text format. For
195
+ the other formats, you may specify the option when you
196
+ call <command>pg_restore</command>.
169
197
</para>
170
198
</listitem>
171
199
</varlistentry>
@@ -175,7 +203,7 @@ Postgres documentation
175
203
<term>--inserts</term>
176
204
<listitem>
177
205
<para>
178
- Dump data as proper <command>INSERT</command> commands (rather
206
+ Dump data as <command>INSERT</command> commands (rather
179
207
than <command>COPY</command>). This will make restoration very
180
208
slow, but it makes the archives more portable to other RDBMS
181
209
packages.
@@ -193,7 +221,8 @@ Postgres documentation
193
221
column names (<literal>INSERT INTO
194
222
<replaceable>table</replaceable>
195
223
(<replaceable>column</replaceable>, ...) VALUES
196
- ...</literal>). This will make restoration very slow.
224
+ ...</literal>). This will make restoration very slow,
225
+ but it is necessary if you desire to rearrange column ordering.
197
226
</para>
198
227
</listitem>
199
228
</varlistentry>
@@ -306,7 +335,7 @@ Postgres documentation
306
335
<listitem>
307
336
<para>
308
337
Dump object identifiers (<acronym>OID</acronym>s) for every
309
- table. Use this option if your application references the oid
338
+ table. Use this option if your application references the OID
310
339
columns in some way (e.g., in a foreign key constraint).
311
340
Otherwise, this option should not be used.
312
341
</para>
@@ -318,7 +347,7 @@ Postgres documentation
318
347
<term>--no-owner</term>
319
348
<listitem>
320
349
<para>
321
- In plain text output mode, do not output commands to set the
350
+ Do not output commands to set the
322
351
object ownership to match the original database. Typically,
323
352
<command>pg_dump</command> issues
324
353
(<command>psql</command>-specific) <command>\connect</command>
@@ -332,7 +361,7 @@ Postgres documentation
332
361
333
362
<para>
334
363
This option is only meaningful for the plain text format. For
335
- the other formats, you need to specify the option when you
364
+ the other formats, you may specify the option when you
336
365
call <command>pg_restore</command>.
337
366
</para>
338
367
</listitem>
@@ -343,7 +372,7 @@ Postgres documentation
343
372
<term>--no-reconnect</term>
344
373
<listitem>
345
374
<para>
346
- In plain text output mode, prohibit <command>pg_dump</command>
375
+ Prohibit <command>pg_dump</command>
347
376
from outputting a script that would require reconnections to
348
377
the database while being restored. An average restoration
349
378
script usually has to reconnect several times as different
@@ -362,7 +391,7 @@ Postgres documentation
362
391
363
392
<para>
364
393
This option is only meaningful for the plain text format. For
365
- the other formats, you need to specify the option when you
394
+ the other formats, you may specify the option when you
366
395
call <command>pg_restore</command>.
367
396
</para>
368
397
</listitem>
@@ -451,7 +480,7 @@ Postgres documentation
451
480
452
481
<para>
453
482
This option is only meaningful for the plain text format. For
454
- the other formats, you need to specify the option when you
483
+ the other formats, you may specify the option when you
455
484
call <command>pg_restore</command>.
456
485
</para>
457
486
</listitem>
0 commit comments