1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

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
This commit is contained in:
Magnus Hagander
2011-01-23 12:21:23 +01:00
parent 6f59777c65
commit 048d148fe6
17 changed files with 1528 additions and 13 deletions

View File

@@ -66,11 +66,12 @@ Node *replication_parse_result;
%token K_IDENTIFY_SYSTEM
%token K_LABEL
%token K_PROGRESS
%token K_FAST
%token K_START_REPLICATION
%type <node> command
%type <node> base_backup start_replication identify_system
%type <boolval> opt_progress
%type <boolval> opt_progress opt_fast
%type <str> opt_label
%%
@@ -102,15 +103,16 @@ identify_system:
;
/*
* BASE_BACKUP [LABEL <label>] [PROGRESS]
* BASE_BACKUP [LABEL <label>] [PROGRESS] [FAST]
*/
base_backup:
K_BASE_BACKUP opt_label opt_progress
K_BASE_BACKUP opt_label opt_progress opt_fast
{
BaseBackupCmd *cmd = (BaseBackupCmd *) makeNode(BaseBackupCmd);
cmd->label = $2;
cmd->progress = $3;
cmd->fastcheckpoint = $4;
$$ = (Node *) cmd;
}
@@ -123,6 +125,9 @@ opt_label: K_LABEL SCONST { $$ = $2; }
opt_progress: K_PROGRESS { $$ = true; }
| /* EMPTY */ { $$ = false; }
;
opt_fast: K_FAST { $$ = true; }
| /* EMPTY */ { $$ = false; }
;
/*
* START_REPLICATION %X/%X