Commit 1570d046 authored by Tom Lane's avatar Tom Lane

Provide a concrete example of parameter expansion in archive_command.

Per discussion of bug #3877.  Simon Riggs, some fixes by moi.
parent 216e63bb
<!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.112 2007/12/17 09:03:52 momjian Exp $ --> <!-- $PostgreSQL: pgsql/doc/src/sgml/backup.sgml,v 2.113 2008/01/23 20:21:37 tgl Exp $ -->
<chapter id="backup"> <chapter id="backup">
<title>Backup and Restore</title> <title>Backup and Restore</title>
...@@ -64,7 +64,7 @@ pg_dump <replaceable class="parameter">dbname</replaceable> &gt; <replaceable cl ...@@ -64,7 +64,7 @@ pg_dump <replaceable class="parameter">dbname</replaceable> &gt; <replaceable cl
</para> </para>
<para> <para>
As any other <productname>PostgreSQL</> client application, Like any other <productname>PostgreSQL</> client application,
<application>pg_dump</> will by default connect with the database <application>pg_dump</> will by default connect with the database
user name that is equal to the current operating system user name. To override user name that is equal to the current operating system user name. To override
this, either specify the <option>-U</option> option or set the this, either specify the <option>-U</option> option or set the
...@@ -407,7 +407,7 @@ tar -cf backup.tar /usr/local/pgsql/data ...@@ -407,7 +407,7 @@ tar -cf backup.tar /usr/local/pgsql/data
smaller than an SQL dump. On the contrary, it will most likely be smaller than an SQL dump. On the contrary, it will most likely be
larger. (<application>pg_dump</application> does not need to dump larger. (<application>pg_dump</application> does not need to dump
the contents of indexes for example, just the commands to recreate the contents of indexes for example, just the commands to recreate
them.) them.) However, taking a file system backup might be faster.
</para> </para>
</sect1> </sect1>
...@@ -556,7 +556,13 @@ archive_command = 'cp -i %p /mnt/server/archivedir/%f &lt;/dev/null' ...@@ -556,7 +556,13 @@ archive_command = 'cp -i %p /mnt/server/archivedir/%f &lt;/dev/null'
</programlisting> </programlisting>
which will copy archivable WAL segments to the directory which will copy archivable WAL segments to the directory
<filename>/mnt/server/archivedir</>. (This is an example, not a <filename>/mnt/server/archivedir</>. (This is an example, not a
recommendation, and might not work on all platforms.) recommendation, and might not work on all platforms.) After the
<literal>%p</> and <literal>%f</> parameters have been replaced,
the actual command executed might look like this:
<programlisting>
cp -i pg_xlog/00000001000000A900000065 /mnt/server/archivedir/00000001000000A900000065 &lt;/dev/null
</programlisting>
A similar command will be generated for each new file to be archived.
</para> </para>
<para> <para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment