diff options
author | Magnus Hagander <magnus@hagander.net> | 2011-01-30 21:30:09 +0100 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2011-01-30 21:30:09 +0100 |
commit | 507069de6dbe18c2163f27fbc780673eef8c5622 (patch) | |
tree | 092966169a76263b98ed927619a4e82599e4d8c5 /doc/src | |
parent | 5d5678d7c3b336a5aacf15d66ac3ebccaab929f2 (diff) | |
download | postgresql-507069de6dbe18c2163f27fbc780673eef8c5622.tar.gz postgresql-507069de6dbe18c2163f27fbc780673eef8c5622.zip |
Add option to include WAL in base backup
When included, this makes the base backup a complete working
"clone" of the initial database, ready to have a postmaster
started against it without the need to set up any log archiving
or similar.
Magnus Hagander, reviewed by Fujii Masao and Heikki Linnakangas
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/protocol.sgml | 19 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_basebackup.sgml | 32 |
2 files changed, 47 insertions, 4 deletions
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 73f26b432da..0775b7a8f4e 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1460,7 +1460,7 @@ The commands accepted in walsender mode are: </varlistentry> <varlistentry> - <term>BASE_BACKUP [<literal>LABEL</literal> <replaceable>'label'</replaceable>] [<literal>PROGRESS</literal>] [<literal>FAST</literal>]</term> + <term>BASE_BACKUP [<literal>LABEL</literal> <replaceable>'label'</replaceable>] [<literal>PROGRESS</literal>] [<literal>FAST</literal>] [<literal>WAL</literal>]</term> <listitem> <para> Instructs the server to start streaming a base backup. @@ -1505,6 +1505,18 @@ The commands accepted in walsender mode are: </para> </listitem> </varlistentry> + + <varlistentry> + <term><literal>WAL</literal></term> + <listitem> + <para> + Include the necessary WAL segments in the backup. This will include + all the files between start and stop backup in the + <filename>pg_xlog</filename> directory of the base directory tar + file. + </para> + </listitem> + </varlistentry> </variablelist> </para> <para> @@ -1561,7 +1573,10 @@ The commands accepted in walsender mode are: </listitem> <listitem> <para> - <filename>pg_xlog</> (including subdirectories) + <filename>pg_xlog</>, including subdirectories. If the backup is run + with wal files included, a synthesized version of pg_xlog will be + included, but it will only contain the files necessary for the + backup to work, not the rest of the contents. </para> </listitem> </itemizedlist> diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 321c8cade1c..f4f78fbbfc5 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -145,6 +145,31 @@ PostgreSQL documentation </varlistentry> <varlistentry> + <term><option>-x</option></term> + <term><option>--xlog</option></term> + <listitem> + <para> + Includes the required transaction log files (WAL files) in the + backup. This will include all transaction logs generated during + the backup. If this option is specified, it is possible to start + a postmaster directly in the extracted directory without the need + to consult the log archive, thus making this a completely standalone + backup. + </para> + <note> + <para> + The transaction log files are collected at the end of the backup. + Therefore, it is necessary for the + <xref linkend="guc-wal-keep-segments"> parameter to be set high + enough that the log is not removed before the end of the backup. + If the log has been rotated when it's time to transfer it, the + backup will fail and be unusable. + </para> + </note> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-Z <replaceable class="parameter">level</replaceable></option></term> <term><option>--compress=<replaceable class="parameter">level</replaceable></option></term> <listitem> @@ -164,7 +189,7 @@ PostgreSQL documentation <variablelist> <varlistentry> <term><option>-c <replaceable class="parameter">fast|spread</replaceable></option></term> - <term><option>--checkpoint <replaceable class="parameter">fast|spread</replaceable></option></term> + <term><option>--checkpoint=<replaceable class="parameter">fast|spread</replaceable></option></term> <listitem> <para> Sets checkpoint mode to fast or spread (default). @@ -191,7 +216,10 @@ PostgreSQL documentation Enables progress reporting. Turning this on will deliver an approximate progress report during the backup. Since the database may change during the backup, this is only an approximation and may not end at exactly - <literal>100%</literal>. + <literal>100%</literal>. In particular, when WAL log is included in the + backup, the total amount of data cannot be estimated in advance, and + in this case the progress report will only count towards the total + amount of data without WAL. </para> <para> When this is enabled, the backup will start by enumerating the size of |