mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
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.
This commit is contained in:
@@ -587,11 +587,23 @@ PostgreSQL documentation
|
||||
tablespaces.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When tar format mode is used, it is the user's responsibility to unpack each
|
||||
tar file before starting postgres. If there are additional tablespaces, the
|
||||
tar files for them need to be unpacked in the correct locations. In this
|
||||
case the symbolic links for those tablespaces will be created by Postgres
|
||||
according to the contents of the <filename>tablespace_map</> file that is
|
||||
included in the <filename>base.tar</> file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<application>pg_basebackup</application> works with servers of the same
|
||||
or an older major version, down to 9.1. However, WAL streaming mode (-X
|
||||
stream) only works with server version 9.3 and later.
|
||||
stream) only works with server version 9.3 and later, and tar format mode
|
||||
(--format=tar) of the current version only works with server version 9.5
|
||||
or later.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
|
Reference in New Issue
Block a user