From 507069de6dbe18c2163f27fbc780673eef8c5622 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Sun, 30 Jan 2011 21:30:09 +0100 Subject: 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 --- doc/src/sgml/protocol.sgml | 19 +++++++++++++++++-- doc/src/sgml/ref/pg_basebackup.sgml | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 4 deletions(-) (limited to 'doc/src') 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: - BASE_BACKUP [LABEL 'label'] [PROGRESS] [FAST] + BASE_BACKUP [LABEL 'label'] [PROGRESS] [FAST] [WAL] Instructs the server to start streaming a base backup. @@ -1505,6 +1505,18 @@ The commands accepted in walsender mode are: + + + WAL + + + Include the necessary WAL segments in the backup. This will include + all the files between start and stop backup in the + pg_xlog directory of the base directory tar + file. + + + @@ -1561,7 +1573,10 @@ The commands accepted in walsender mode are: - pg_xlog (including subdirectories) + 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. 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 @@ -144,6 +144,31 @@ PostgreSQL documentation + + + + + + 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. + + + + The transaction log files are collected at the end of the backup. + Therefore, it is necessary for the + 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. + + + + + @@ -164,7 +189,7 @@ PostgreSQL documentation - + 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 - 100%. + 100%. 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. When this is enabled, the backup will start by enumerating the size of -- cgit v1.2.3