diff options
| author | Andrew Dunstan | 2015-05-12 13:29:10 +0000 |
|---|---|---|
| committer | Andrew Dunstan | 2015-05-12 13:29:10 +0000 |
| commit | 72d422a5227ef6f76f412486a395aba9f53bf3f0 (patch) | |
| tree | c94ffeef53c5e4a4ce0c4b055a8256ee6af3b947 /src/bin/pg_basebackup/pg_basebackup.c | |
| parent | d02f16470f117db3038dbfd87662d5f0eb5a2a9b (diff) | |
Map basebackup tablespaces using a tablespace_map file
Windows can't reliably restore symbolic links from a tar format, so
instead during backup start we create a tablespace_map file, which is
used by the restoring postgres to create the correct links in pg_tblspc.
The backup protocol also now has an option to request this file to be
included in the backup stream, and this is used by pg_basebackup when
operating in tar mode.
This is done on all platforms, not just Windows.
This means that pg_basebackup will not not work in tar mode against 9.4
and older servers, as this protocol option isn't implemented there.
Amit Kapila, reviewed by Dilip Kumar, with a little editing from me.
Diffstat (limited to 'src/bin/pg_basebackup/pg_basebackup.c')
| -rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 83bf2f5519f..2d0ea7bad86 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1652,13 +1652,14 @@ BaseBackup(void) maxrate_clause = psprintf("MAX_RATE %u", maxrate); basebkp = - psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s", + psprintf("BASE_BACKUP LABEL '%s' %s %s %s %s %s %s", escaped_label, showprogress ? "PROGRESS" : "", includewal && !streamwal ? "WAL" : "", fastcheckpoint ? "FAST" : "", includewal ? "NOWAIT" : "", - maxrate_clause ? maxrate_clause : ""); + maxrate_clause ? maxrate_clause : "", + format == 't' ? "TABLESPACE_MAP": ""); if (PQsendQuery(conn, basebkp) == 0) { |
