Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 048d148

Browse files
committed
Add pg_basebackup tool for streaming base backups
This tool makes it possible to do the pg_start_backup/ copy files/pg_stop_backup step in a single command. There are still some steps to be done before this is a complete backup solution, such as the ability to stream the required WAL logs, but it's still usable, and could do with some buildfarm coverage. In passing, make the checkpoint request optionally fast instead of hardcoding it. Magnus Hagander, reviewed by Fujii Masao and Dimitri Fontaine
1 parent 6f59777 commit 048d148

File tree

17 files changed

+1528
-13
lines changed

17 files changed

+1528
-13
lines changed

doc/src/sgml/backup.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,16 @@ SELECT pg_stop_backup();
812812
</orderedlist>
813813
</para>
814814

815+
<para>
816+
You can also use the <xref linkend="app-pgbasebackup"> tool to take
817+
the backup, instead of manually copying the files. This tool will take
818+
care of the <function>pg_start_backup()</>, copy and
819+
<function>pg_stop_backup()</> steps automatically, and transfers the
820+
backup over a regular <productname>PostgreSQL</productname> connection
821+
using the replication protocol, instead of requiring filesystem level
822+
access.
823+
</para>
824+
815825
<para>
816826
Some file system backup tools emit warnings or errors
817827
if the files they are trying to copy change while the copy proceeds.

doc/src/sgml/config.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,8 @@ SET ENABLE_SEQSCAN TO OFF;
19211921
<listitem>
19221922
<para>
19231923
Specifies the maximum number of concurrent connections from standby
1924-
servers (i.e., the maximum number of simultaneously running WAL sender
1924+
servers or streaming base backup clients (i.e., the maximum number of
1925+
simultaneously running WAL sender
19251926
processes). The default is zero. This parameter can only be set at
19261927
server start. <varname>wal_level</> must be set to <literal>archive</>
19271928
or <literal>hot_standby</> to allow connections from standby servers.

doc/src/sgml/protocol.sgml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ The commands accepted in walsender mode are:
14601460
</varlistentry>
14611461

14621462
<varlistentry>
1463-
<term>BASE_BACKUP [<literal>LABEL</literal> <replaceable>'label'</replaceable>] [<literal>PROGRESS</literal>]</term>
1463+
<term>BASE_BACKUP [<literal>LABEL</literal> <replaceable>'label'</replaceable>] [<literal>PROGRESS</literal>] [<literal>FAST</literal>]</term>
14641464
<listitem>
14651465
<para>
14661466
Instructs the server to start streaming a base backup.
@@ -1496,6 +1496,15 @@ The commands accepted in walsender mode are:
14961496
</para>
14971497
</listitem>
14981498
</varlistentry>
1499+
1500+
<varlistentry>
1501+
<term><literal>FAST</></term>
1502+
<listitem>
1503+
<para>
1504+
Request a fast checkpoint.
1505+
</para>
1506+
</listitem>
1507+
</varlistentry>
14991508
</variablelist>
15001509
</para>
15011510
<para>

doc/src/sgml/ref/allfiles.sgml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Complete list of usable sgml source files in this directory.
160160
<!entity dropuser system "dropuser.sgml">
161161
<!entity ecpgRef system "ecpg-ref.sgml">
162162
<!entity initdb system "initdb.sgml">
163+
<!entity pgBasebackup system "pg_basebackup.sgml">
163164
<!entity pgConfig system "pg_config-ref.sgml">
164165
<!entity pgControldata system "pg_controldata.sgml">
165166
<!entity pgCtl system "pg_ctl-ref.sgml">

0 commit comments

Comments
 (0)