1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.96 2007/01/31 20:56 :16 momjian Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.97 2007/02/01 00:28 :16 momjian Exp $ -->
2
2
3
3
<chapter id="backup">
4
4
<title>Backup and Restore</title>
@@ -221,20 +221,20 @@ psql -f <replaceable class="parameter">infile</replaceable> postgres
221
221
<title>Use compressed dumps.</title>
222
222
<para>
223
223
You can use your favorite compression program, for example
224
- <application>gzip</application>.
224
+ <application>gzip</application>:
225
225
226
226
<programlisting>
227
227
pg_dump <replaceable class="parameter">dbname</replaceable> | gzip > <replaceable class="parameter">filename</replaceable>.gz
228
228
</programlisting>
229
229
230
- Reload with
230
+ Reload with:
231
231
232
232
<programlisting>
233
233
createdb <replaceable class="parameter">dbname</replaceable>
234
234
gunzip -c <replaceable class="parameter">filename</replaceable>.gz | psql <replaceable class="parameter">dbname</replaceable>
235
235
</programlisting>
236
236
237
- or
237
+ or:
238
238
239
239
<programlisting>
240
240
cat <replaceable class="parameter">filename</replaceable>.gz | gunzip | psql <replaceable class="parameter">dbname</replaceable>
@@ -254,7 +254,7 @@ cat <replaceable class="parameter">filename</replaceable>.gz | gunzip | psql <re
254
254
pg_dump <replaceable class="parameter">dbname</replaceable> | split -b 1m - <replaceable class="parameter">filename</replaceable>
255
255
</programlisting>
256
256
257
- Reload with
257
+ Reload with:
258
258
259
259
<programlisting>
260
260
createdb <replaceable class="parameter">dbname</replaceable>
@@ -296,7 +296,7 @@ pg_dump -Fc <replaceable class="parameter">dbname</replaceable> > <replaceabl
296
296
<xref linkend="creating-cluster"> it is explained where these files
297
297
are located, but you have probably found them already if you are
298
298
interested in this method. You can use whatever method you prefer
299
- for doing usual file system backups, for example
299
+ for doing usual file system backups, for example:
300
300
301
301
<programlisting>
302
302
tar -cf backup.tar /usr/local/pgsql/data
@@ -528,7 +528,7 @@ tar -cf backup.tar /usr/local/pgsql/data
528
528
i.e., the cluster's data directory.)
529
529
Write <literal>%%</> if you need to embed an actual <literal>%</>
530
530
character in the command. The simplest useful command is something
531
- like
531
+ like:
532
532
<programlisting>
533
533
archive_command = 'cp -i %p /mnt/server/archivedir/%f </dev/null'
534
534
</programlisting>
@@ -568,7 +568,7 @@ archive_command = 'cp -i %p /mnt/server/archivedir/%f </dev/null'
568
568
this correctly on some platforms but not others. If the chosen command
569
569
does not itself handle this case correctly, you should add a command
570
570
to test for pre-existence of the archive file. For example, something
571
- like
571
+ like:
572
572
<programlisting>
573
573
archive_command = 'test ! -f .../%f && cp %p .../%f'
574
574
</programlisting>
@@ -657,7 +657,7 @@ archive_command = 'test ! -f .../%f && cp %p .../%f'
657
657
</listitem>
658
658
<listitem>
659
659
<para>
660
- Connect to the database as a superuser, and issue the command
660
+ Connect to the database as a superuser, and issue the command:
661
661
<programlisting>
662
662
SELECT pg_start_backup('label');
663
663
</programlisting>
@@ -685,7 +685,7 @@ SELECT pg_start_backup('label');
685
685
</listitem>
686
686
<listitem>
687
687
<para>
688
- Again connect to the database as a superuser, and issue the command
688
+ Again connect to the database as a superuser, and issue the command:
689
689
<programlisting>
690
690
SELECT pg_stop_backup();
691
691
</programlisting>
@@ -924,7 +924,7 @@ SELECT pg_stop_backup();
924
924
i.e., the cluster's data directory.)
925
925
Write <literal>%%</> if you need to embed an actual <literal>%</>
926
926
character in the command. The simplest useful command is
927
- something like
927
+ something like:
928
928
<programlisting>
929
929
restore_command = 'cp /mnt/server/archivedir/%f %p'
930
930
</programlisting>
@@ -1669,7 +1669,7 @@ if (!triggered)
1669
1669
<para>
1670
1670
The least downtime can be achieved by installing the new server in
1671
1671
a different directory and running both the old and the new servers
1672
- in parallel, on different ports. Then you can use something like
1672
+ in parallel, on different ports. Then you can use something like:
1673
1673
1674
1674
<programlisting>
1675
1675
pg_dumpall -p 5432 | psql -d postgres -p 6543
0 commit comments