Map basebackup tablespaces using a tablespace_map file
Andrew Dunstan <andrew@dunslane.net>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/backup.sgml | modified | +19 −13 |
| doc/src/sgml/func.sgml | modified | +8 −6 |
| doc/src/sgml/protocol.sgml | modified | +14 −1 |
| doc/src/sgml/ref/pg_basebackup.sgml | modified | +13 −1 |
| src/backend/access/transam/xlog.c | modified | +366 −21 |
| src/backend/access/transam/xlogfuncs.c | modified | +11 −1 |
| src/backend/replication/basebackup.c | modified | +53 −85 |
| src/backend/replication/repl_gram.y | modified | +13 −3 |
| src/backend/replication/repl_scanner.l | modified | +1 −0 |
| src/bin/pg_basebackup/pg_basebackup.c | modified | +3 −2 |
| src/include/access/xlog.h | modified | +8 −1 |
| src/include/replication/basebackup.h | modified | +10 −0 |