pg_upgrade: Allow use of file cloning
authorPeter Eisentraut <peter_e@gmx.net>
Wed, 7 Nov 2018 17:05:54 +0000 (18:05 +0100)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 7 Nov 2018 17:35:20 +0000 (18:35 +0100)
commit3a769d8239afdc003c91a56d2d8d5adfadacda5d
treedd9b3cf3f6e93aaacdee009c5bcc0f3193887743
parent5f32b29c18195299e90c1fb6c8945e9a46d772d2
pg_upgrade: Allow use of file cloning

Add another transfer mode --clone to pg_upgrade (besides the existing
--link and the default copy), using special file cloning calls.  This
makes the file transfer faster and more space efficient, achieving
speed similar to --link mode without the associated drawbacks.

On Linux, file cloning is supported on Btrfs and XFS (if formatted with
reflink support).  On macOS, file cloning is supported on APFS.

Reviewed-by: Michael Paquier <michael@paquier.xyz>
configure
configure.in
doc/src/sgml/ref/pgupgrade.sgml
src/bin/pg_upgrade/check.c
src/bin/pg_upgrade/file.c
src/bin/pg_upgrade/option.c
src/bin/pg_upgrade/pg_upgrade.h
src/bin/pg_upgrade/relfilenode.c
src/include/pg_config.h.in