{"Entry":{"collection":"tool","key":"pg-combinebackup","name":"pg_combinebackup","aliases":["pg_combinebackup"],"metadata":{"aliases":["pg_combinebackup"],"category":"Client applications","content_hash":"258d84862b30064c6adfc374ea1e7fc829c0bc74e993ae5f31ae14e4d24a4531","imported_at":"2026-09-30T00:40:34.103994+08:00","name":"pg_combinebackup","name_zh":"","slug":"pg-combinebackup","summary":"pg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups"}},"Definition":{"Collection":"tool","Key":"pg-combinebackup","SourceDatabase":"center","Version":"18","SourceTable":"command_tool","SourceKey":"pg-combinebackup","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","Facts":{"comparison_data":{"environment":[],"options":[{"description":"Print lots of debug logging output on stderr .","names":["-d","--debug"],"signature":"-d --debug"},{"description":"Use hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after pg_combinebackup has completed. Requires that the input backups and the output directory are in the same file system. If a backup manifest is not available or does not contain checksum of the right type, hard links will still be created, but the file will be also read block-by-block for the checksum calculation.","names":["-k","--link"],"signature":"-k --link"},{"description":"The -n / --dry-run option instructs pg_combinebackup to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with --debug .","names":["-n","--dry-run"],"signature":"-n --dry-run"},{"description":"By default, pg_combinebackup will wait for all files to be written safely to disk. This option causes pg_combinebackup to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation.","names":["-N","--no-sync"],"signature":"-N --no-sync"},{"description":"Specifies the output directory to which the synthetic full backup should be written. Currently, this argument is required.","names":["-o outputdir","--output= outputdir"],"signature":"-o outputdir --output= outputdir"},{"description":"Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign ( = ), precede that with a backslash. This option can be specified multiple times for multiple tablespaces.","names":["-T olddir = newdir","--tablespace-mapping= olddir = newdir"],"signature":"-T olddir = newdir --tablespace-mapping= olddir = newdir"},{"description":"Use efficient file cloning (also known as “ reflinks ” on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files. If a backup manifest is not available or does not contain checksum of the right type, file cloning will be used to copy the file, but the file will be also read block-by-block for the checksum calculation. File cloning is only supported on some operating systems and file systems. If it is selected but not supported, the pg_combinebackup run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS.","names":["--clone"],"signature":"--clone"},{"description":"Perform regular file copy. This is the default. (See also --copy-file-range , --clone , and -k / --link .)","names":["--copy"],"signature":"--copy"},{"description":"Use the copy_file_range system call for efficient copying. On some file systems this gives results similar to --clone , sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD. If a backup manifest is not available or does not contain checksum of the right type, copy_file_range will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.","names":["--copy-file-range"],"signature":"--copy-file-range"},{"description":"Like pg_basebackup , pg_combinebackup writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are NONE , CRC32C , SHA224 , SHA256 , SHA384 , and SHA512 . The default is CRC32C .","names":["--manifest-checksums= algorithm"],"signature":"--manifest-checksums= algorithm"},{"description":"Disables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory.","names":["--no-manifest"],"signature":"--no-manifest"},{"description":"When set to fsync , which is the default, pg_combinebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, pg_combinebackup will also synchronize the file systems that contain the WAL files and each tablespace. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used.","names":["--sync-method= method"],"signature":"--sync-method= method"},{"description":"Prints the pg_combinebackup version and exits.","names":["-V","--version"],"signature":"-V --version"},{"description":"Shows help about pg_combinebackup command line arguments, and exits.","names":["-?","--help"],"signature":"-? --help"}],"synopsis":["pg_combinebackup [ option ...] [ backup_directory ...]"]},"comparison_hash":"59008256ecaf745d4645dde1d240c93697d28d59a42c9b28b8c7a30b44585384","description":["pg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups"],"environment":[],"facts":[{"label":"Documented executable","value":"pg_combinebackup"},{"label":"Executable version","value":"18.6"},{"label":"Reference inventory","value":"Client applications"},{"label":"Option definition groups","value":"14"}],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCOMBINEBACKUP\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.12.4.1\"\u003e\u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003ebackup_directory\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e is used to reconstruct a synthetic full backup from an \u003ca class=\"link\" href=\"/docs/18/continuous-archiving.html#BACKUP-INCREMENTAL-BACKUP\" title=\"25.3.3. Making an Incremental Backup\"\u003eincremental backup\u003c/a\u003e and the earlier backups upon which it depends.\u003c/p\u003e\n\u003cp\u003eSpecify all of the required backups on the command line from oldest to newest. That is, the first backup directory should be the path to the full backup, and the last should be the path to the final incremental backup that you wish to restore. The reconstructed backup will be written to the output directory specified by the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e will attempt to verify that the backups you specify form a legal backup chain from which a correct full backup can be reconstructed. However, it is not designed to help you keep track of which backups depend on which other backups. If you remove one or more of the previous backups upon which your incremental backup relies, you will not be able to restore it. Moreover, \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e only attempts to verify that the backups have the correct relationship to each other, not that each individual backup is intact; for that, use \u003ca class=\"xref\" href=\"/docs/18/app-pgverifybackup.html\" title=\"pg_verifybackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_verifybackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eSince the output of \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e is a synthetic full backup, it can be used as an input to a future invocation of \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e. The synthetic full backup would be specified on the command line in lieu of the chain of backups from which it was reconstructed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--debug\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint lots of debug logging output on \u003ccode class=\"filename\"\u003estderr\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-k\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--link\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e has completed.\u003c/p\u003e\n\u003cp\u003eRequires that the input backups and the output directory are in the same file system.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, hard links will still be created, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-n\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--dry-run\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e-n\u003c/code\u003e/\u003ccode class=\"option\"\u003e--dry-run\u003c/code\u003e option instructs \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with \u003ccode class=\"option\"\u003e--debug\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--output=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the output directory to which the synthetic full backup should be written. Currently, this argument is required.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--tablespace-mapping=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRelocates the tablespace in directory \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e to \u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e during the backup. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e is the absolute path of the tablespace as it exists in the final backup specified on the command line, and \u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign (\u003ccode class=\"literal\"\u003e=\u003c/code\u003e), precede that with a backslash. This option can be specified multiple times for multiple tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--clone\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse efficient file cloning (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003ereflinks\u003c/span\u003e”\u003c/span\u003e on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, file cloning will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003cp\u003eFile cloning is only supported on some operating systems and file systems. If it is selected but not supported, the \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform regular file copy. This is the default. (See also \u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e, \u003ccode class=\"option\"\u003e--clone\u003c/code\u003e, and \u003ccode class=\"option\"\u003e-k\u003c/code\u003e/\u003ccode class=\"option\"\u003e--link\u003c/code\u003e.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e system call for efficient copying. On some file systems this gives results similar to \u003ccode class=\"option\"\u003e--clone\u003c/code\u003e, sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--manifest-checksums=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ealgorithm\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLike \u003ca class=\"xref\" href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are \u003ccode class=\"literal\"\u003eNONE\u003c/code\u003e, \u003ccode class=\"literal\"\u003eCRC32C\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA224\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA256\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA384\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eSHA512\u003c/code\u003e. The default is \u003ccode class=\"literal\"\u003eCRC32C\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-manifest\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sync-method=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode class=\"literal\"\u003efsync\u003c/code\u003e, which is the default, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will also synchronize the file systems that contain the WAL files and each tablespace. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e version and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShows help about \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e command line arguments, and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PGCOMBINEBACKUP-LIMITATIONS\"\u003e\n\u003ch2\u003eLimitations\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"literal\"\u003epg_combinebackup\u003c/code\u003e does not recompute page checksums when writing the output directory. Therefore, if any of the backups used for reconstruction were taken with checksums disabled, but the final backup was taken with checksums enabled, the resulting directory may contain pages with invalid checksums.\u003c/p\u003e\n\u003cp\u003eTo avoid this problem, taking a new full backup after changing the checksum state of the cluster using \u003ca class=\"xref\" href=\"/docs/18/app-pgchecksums.html\" title=\"pg_checksums\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e is recommended. Otherwise, you can disable and then optionally reenable checksums on the directory produced by \u003ccode class=\"literal\"\u003epg_combinebackup\u003c/code\u003e in order to correct the problem.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.8\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","manual_path":"app-pgcombinebackup.html","options":[{"description":"Print lots of debug logging output on stderr .","names":["-d","--debug"],"signature":"-d --debug","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Print lots of debug logging output on stderr ."},{"description":"Use hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after pg_combinebackup has completed. Requires that the input backups and the output directory are in the same file system. If a backup manifest is not available or does not contain checksum of the right type, hard links will still be created, but the file will be also read block-by-block for the checksum calculation.","names":["-k","--link"],"signature":"-k --link","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Use hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after pg_combinebackup has completed."},{"description":"The -n / --dry-run option instructs pg_combinebackup to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with --debug .","names":["-n","--dry-run"],"signature":"-n --dry-run","source_url":"/docs/18/app-pgcombinebackup.html","summary":"The -n / --dry-run option instructs pg_combinebackup to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with --debug ."},{"description":"By default, pg_combinebackup will wait for all files to be written safely to disk. This option causes pg_combinebackup to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation.","names":["-N","--no-sync"],"signature":"-N --no-sync","source_url":"/docs/18/app-pgcombinebackup.html","summary":"By default, pg_combinebackup will wait for all files to be written safely to disk. This option causes pg_combinebackup to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation."},{"description":"Specifies the output directory to which the synthetic full backup should be written. Currently, this argument is required.","names":["-o outputdir","--output= outputdir"],"signature":"-o outputdir --output= outputdir","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Specifies the output directory to which the synthetic full backup should be written. Currently, this argument is required."},{"description":"Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign ( = ), precede that with a backslash. This option can be specified multiple times for multiple tablespaces.","names":["-T olddir = newdir","--tablespace-mapping= olddir = newdir"],"signature":"-T olddir = newdir --tablespace-mapping= olddir = newdir","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign ( = ), precede that with a backslash. This option can be specified multiple times for multiple tablespaces."},{"description":"Use efficient file cloning (also known as “ reflinks ” on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files. If a backup manifest is not available or does not contain checksum of the right type, file cloning will be used to copy the file, but the file will be also read block-by-block for the checksum calculation. File cloning is only supported on some operating systems and file systems. If it is selected but not supported, the pg_combinebackup run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS.","names":["--clone"],"signature":"--clone","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Use efficient file cloning (also known as “ reflinks ” on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files."},{"description":"Perform regular file copy. This is the default. (See also --copy-file-range , --clone , and -k / --link .)","names":["--copy"],"signature":"--copy","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Perform regular file copy. This is the default. (See also --copy-file-range , --clone , and -k / --link .)"},{"description":"Use the copy_file_range system call for efficient copying. On some file systems this gives results similar to --clone , sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD. If a backup manifest is not available or does not contain checksum of the right type, copy_file_range will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.","names":["--copy-file-range"],"signature":"--copy-file-range","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Use the copy_file_range system call for efficient copying. On some file systems this gives results similar to --clone , sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD."},{"description":"Like pg_basebackup , pg_combinebackup writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are NONE , CRC32C , SHA224 , SHA256 , SHA384 , and SHA512 . The default is CRC32C .","names":["--manifest-checksums= algorithm"],"signature":"--manifest-checksums= algorithm","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Like pg_basebackup , pg_combinebackup writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are NONE , CRC32C , SHA224 , SHA256 , SHA384 , and SHA512 . The default is CRC32C ."},{"description":"Disables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory.","names":["--no-manifest"],"signature":"--no-manifest","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Disables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory."},{"description":"When set to fsync , which is the default, pg_combinebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace. On Linux, syncfs may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, pg_combinebackup will also synchronize the file systems that contain the WAL files and each tablespace. See recovery_init_sync_method for information about the caveats to be aware of when using syncfs . This option has no effect when --no-sync is used.","names":["--sync-method= method"],"signature":"--sync-method= method","source_url":"/docs/18/app-pgcombinebackup.html","summary":"When set to fsync , which is the default, pg_combinebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"description":"Prints the pg_combinebackup version and exits.","names":["-V","--version"],"signature":"-V --version","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Prints the pg_combinebackup version and exits."},{"description":"Shows help about pg_combinebackup command line arguments, and exits.","names":["-?","--help"],"signature":"-? --help","source_url":"/docs/18/app-pgcombinebackup.html","summary":"Shows help about pg_combinebackup command line arguments, and exits."}],"related":[],"release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sections":[],"signature":"pg_combinebackup [ option ...] [ backup_directory ...]","sources":[{"anchor":"","file":"app-pgcombinebackup.html","label":"18.6 English manual · app-pgcombinebackup.html","sha256":"919ea0092ca93f97635f32b55c31e519379c8f693b26f91826a9f9b8c4ba2717","url":"/docs/18/app-pgcombinebackup.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}],"synopsis":["pg_combinebackup [ option ...] [ backup_directory ...]"],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-d --debug","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Print lots of debug logging output on stderr ."},{"signature":{"text":"-k --link","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after pg_combinebackup has completed."},{"signature":{"text":"-n --dry-run","url":"/docs/18/app-pgcombinebackup.html"},"summary":"The -n / --dry-run option instructs pg_combinebackup to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with --debug ."},{"signature":{"text":"-N --no-sync","url":"/docs/18/app-pgcombinebackup.html"},"summary":"By default, pg_combinebackup will wait for all files to be written safely to disk. This option causes pg_combinebackup to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation."},{"signature":{"text":"-o outputdir --output= outputdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Specifies the output directory to which the synthetic full backup should be written. Currently, this argument is required."},{"signature":{"text":"-T olddir = newdir --tablespace-mapping= olddir = newdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign ( = ), precede that with a backslash. This option can be specified multiple times for multiple tablespaces."},{"signature":{"text":"--clone","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use efficient file cloning (also known as “ reflinks ” on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files."},{"signature":{"text":"--copy","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Perform regular file copy. This is the default. (See also --copy-file-range , --clone , and -k / --link .)"},{"signature":{"text":"--copy-file-range","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use the copy_file_range system call for efficient copying. On some file systems this gives results similar to --clone , sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD."},{"signature":{"text":"--manifest-checksums= algorithm","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Like pg_basebackup , pg_combinebackup writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are NONE , CRC32C , SHA224 , SHA256 , SHA384 , and SHA512 . The default is CRC32C ."},{"signature":{"text":"--no-manifest","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Disables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory."},{"signature":{"text":"--sync-method= method","url":"/docs/18/app-pgcombinebackup.html"},"summary":"When set to fsync , which is the default, pg_combinebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Prints the pg_combinebackup version and exits."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Shows help about pg_combinebackup command line arguments, and exits."}],"title":"Documented options"}]},"ManualEvidence":{"manual_path":"app-pgcombinebackup.html","release":{"channel":"stable","evidence_kind":"English manual and source declarations","label":"18.6","major":"18","manifest":{"index":"index.html","major":"18","pages":1148,"pdf":{"A4":{"built_at":"2026-09-26","bytes":15865106,"pages":3154,"sha256":"19512c405da53f9f7fcf0abba359223aa65f021be025bf3411381918f92e3190","url":"/files/documentation/pdf/18/postgresql-18-A4.pdf"},"US":{"built_at":"2026-09-26","bytes":15748059,"pages":3328,"sha256":"facbe6c229e598b872d3d98bef53308f46e06746006fa4590de9a7de9dd46319","url":"/files/documentation/pdf/18/postgresql-18-US.pdf"}},"release":"18.6","source_mode":"en SGML built with pinned official archive","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","svg_assets":3,"tree":"18"},"ref":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2","revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","source_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f"},"sources":[{"anchor":"","file":"app-pgcombinebackup.html","label":"18.6 English manual · app-pgcombinebackup.html","sha256":"919ea0092ca93f97635f32b55c31e519379c8f693b26f91826a9f9b8c4ba2717","url":"/docs/18/app-pgcombinebackup.html"},{"anchor":"","file":"reference-client.html","label":"Client applications inventory","sha256":"68f726af77272fe73a827be2b7b5958d0f2239a6f8ed44264e9d42496bfa4fd0","url":"/docs/18/reference-client.html"}]},"MeasuredEvidence":{}},"Text":{"Collection":"tool","Key":"pg-combinebackup","SourceDatabase":"center","Version":"18","Locale":"en","Title":"pg_combinebackup","Summary":"pg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups","BodyHTML":"\u003cdiv\u003e\u003cdiv id=\"APP-PGCOMBINEBACKUP\"\u003e\n\u003cdiv\u003e\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003e\u003cspan\u003e\u003cspan\u003epg_combinebackup\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cp id=\"id-1.9.4.12.4.1\"\u003e\u003ccode\u003epg_combinebackup\u003c/code\u003e [\u003cem\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem\u003e\u003ccode\u003ebackup_directory\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.12.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan\u003epg_combinebackup\u003c/span\u003e is used to reconstruct a synthetic full backup from an \u003ca href=\"/docs/18/continuous-archiving.html#BACKUP-INCREMENTAL-BACKUP\" rel=\"nofollow\"\u003eincremental backup\u003c/a\u003e and the earlier backups upon which it depends.\u003c/p\u003e\n\u003cp\u003eSpecify all of the required backups on the command line from oldest to newest. That is, the first backup directory should be the path to the full backup, and the last should be the path to the final incremental backup that you wish to restore. The reconstructed backup will be written to the output directory specified by the \u003ccode\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003e\u003cspan\u003epg_combinebackup\u003c/span\u003e will attempt to verify that the backups you specify form a legal backup chain from which a correct full backup can be reconstructed. However, it is not designed to help you keep track of which backups depend on which other backups. If you remove one or more of the previous backups upon which your incremental backup relies, you will not be able to restore it. Moreover, \u003cspan\u003epg_combinebackup\u003c/span\u003e only attempts to verify that the backups have the correct relationship to each other, not that each individual backup is intact; for that, use \u003ca href=\"/docs/18/app-pgverifybackup.html\" title=\"pg_verifybackup\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_verifybackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eSince the output of \u003cspan\u003epg_combinebackup\u003c/span\u003e is a synthetic full backup, it can be used as an input to a future invocation of \u003cspan\u003epg_combinebackup\u003c/span\u003e. The synthetic full backup would be specified on the command line in lieu of the chain of backups from which it was reconstructed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.12.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv\u003e\n\u003cdl\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--debug\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint lots of debug logging output on \u003ccode\u003estderr\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-k\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--link\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after \u003cspan\u003epg_combinebackup\u003c/span\u003e has completed.\u003c/p\u003e\n\u003cp\u003eRequires that the input backups and the output directory are in the same file system.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, hard links will still be created, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-n\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--dry-run\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe \u003ccode\u003e-n\u003c/code\u003e/\u003ccode\u003e--dry-run\u003c/code\u003e option instructs \u003ccode\u003epg_combinebackup\u003c/code\u003e to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with \u003ccode\u003e--debug\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode\u003epg_combinebackup\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode\u003epg_combinebackup\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-o \u003cem\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--output=\u003cem\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the output directory to which the synthetic full backup should be written. Currently, this argument is required.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-T \u003cem\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--tablespace-mapping=\u003cem\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRelocates the tablespace in directory \u003cem\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e to \u003cem\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e during the backup. \u003cem\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e is the absolute path of the tablespace as it exists in the final backup specified on the command line, and \u003cem\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign (\u003ccode\u003e=\u003c/code\u003e), precede that with a backslash. This option can be specified multiple times for multiple tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--clone\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse efficient file cloning (also known as \u003cspan\u003e“\u003cspan\u003ereflinks\u003c/span\u003e”\u003c/span\u003e on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, file cloning will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003cp\u003eFile cloning is only supported on some operating systems and file systems. If it is selected but not supported, the \u003cspan\u003epg_combinebackup\u003c/span\u003e run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--copy\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform regular file copy. This is the default. (See also \u003ccode\u003e--copy-file-range\u003c/code\u003e, \u003ccode\u003e--clone\u003c/code\u003e, and \u003ccode\u003e-k\u003c/code\u003e/\u003ccode\u003e--link\u003c/code\u003e.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--copy-file-range\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the \u003ccode\u003ecopy_file_range\u003c/code\u003e system call for efficient copying. On some file systems this gives results similar to \u003ccode\u003e--clone\u003c/code\u003e, sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, \u003ccode\u003ecopy_file_range\u003c/code\u003e will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--manifest-checksums=\u003cem\u003e\u003ccode\u003ealgorithm\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLike \u003ca href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003cspan\u003epg_combinebackup\u003c/span\u003e writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are \u003ccode\u003eNONE\u003c/code\u003e, \u003ccode\u003eCRC32C\u003c/code\u003e, \u003ccode\u003eSHA224\u003c/code\u003e, \u003ccode\u003eSHA256\u003c/code\u003e, \u003ccode\u003eSHA384\u003c/code\u003e, and \u003ccode\u003eSHA512\u003c/code\u003e. The default is \u003ccode\u003eCRC32C\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--no-manifest\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e--sync-method=\u003cem\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode\u003efsync\u003c/code\u003e, which is the default, \u003ccode\u003epg_combinebackup\u003c/code\u003e will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, \u003ccode\u003epg_combinebackup\u003c/code\u003e will also synchronize the file systems that contain the WAL files and each tablespace. See \u003ca href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\" rel=\"nofollow\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the \u003cspan\u003epg_combinebackup\u003c/span\u003e version and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan\u003e\u003ccode\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan\u003e\u003ccode\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShows help about \u003cspan\u003epg_combinebackup\u003c/span\u003e command line arguments, and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv id=\"APP-PGCOMBINEBACKUP-LIMITATIONS\"\u003e\n\u003ch2\u003eLimitations\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003epg_combinebackup\u003c/code\u003e does not recompute page checksums when writing the output directory. Therefore, if any of the backups used for reconstruction were taken with checksums disabled, but the final backup was taken with checksums enabled, the resulting directory may contain pages with invalid checksums.\u003c/p\u003e\n\u003cp\u003eTo avoid this problem, taking a new full backup after changing the checksum state of the cluster using \u003ca href=\"/docs/18/app-pgchecksums.html\" title=\"pg_checksums\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e is recommended. Otherwise, you can disable and then optionally reenable checksums on the directory produced by \u003ccode\u003epg_combinebackup\u003c/code\u003e in order to correct the problem.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.12.8\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThis utility, like most other \u003cspan\u003ePostgreSQL\u003c/span\u003e utilities, uses the environment variables supported by \u003cspan\u003elibpq\u003c/span\u003e (see \u003ca href=\"/docs/18/libpq-envars.html\" rel=\"nofollow\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThe environment variable \u003ccode\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode\u003ealways\u003c/code\u003e, \u003ccode\u003eauto\u003c/code\u003e and \u003ccode\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv id=\"id-1.9.4.12.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan\u003e\u003ca href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\" rel=\"nofollow\"\u003e\u003cspan\u003e\u003cspan\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","SourceRevision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8","ContentHash":"92cc865ba8efe1a5ada73b8f4619e08d4194aae65306af8d398a7b142e10ec40","Payload":{"description":["pg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups"],"manual_html":"\u003cdiv\u003e\u003cdiv class=\"refentry\" id=\"APP-PGCOMBINEBACKUP\"\u003e\n\u003cdiv class=\"titlepage\"\u003e\u003c/div\u003e\n\u003cdiv class=\"refnamediv\"\u003e\n\u003ch2\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e\u003c/span\u003e\u003c/h2\u003e\n\u003cp\u003epg_combinebackup — reconstruct a full backup from an incremental backup and dependent backups\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsynopsisdiv\"\u003e\n\u003ch2\u003eSynopsis\u003c/h2\u003e\n\u003cdiv class=\"cmdsynopsis\"\u003e\n\u003cp id=\"id-1.9.4.12.4.1\"\u003e\u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e [\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoption\u003c/code\u003e\u003c/em\u003e...] [\u003cem class=\"replaceable\"\u003e\u003ccode\u003ebackup_directory\u003c/code\u003e\u003c/em\u003e...]\u003c/p\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.5\"\u003e\n\u003ch2\u003eDescription\u003c/h2\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e is used to reconstruct a synthetic full backup from an \u003ca class=\"link\" href=\"/docs/18/continuous-archiving.html#BACKUP-INCREMENTAL-BACKUP\" title=\"25.3.3. Making an Incremental Backup\"\u003eincremental backup\u003c/a\u003e and the earlier backups upon which it depends.\u003c/p\u003e\n\u003cp\u003eSpecify all of the required backups on the command line from oldest to newest. That is, the first backup directory should be the path to the full backup, and the last should be the path to the final incremental backup that you wish to restore. The reconstructed backup will be written to the output directory specified by the \u003ccode class=\"option\"\u003e-o\u003c/code\u003e option.\u003c/p\u003e\n\u003cp\u003e\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e will attempt to verify that the backups you specify form a legal backup chain from which a correct full backup can be reconstructed. However, it is not designed to help you keep track of which backups depend on which other backups. If you remove one or more of the previous backups upon which your incremental backup relies, you will not be able to restore it. Moreover, \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e only attempts to verify that the backups have the correct relationship to each other, not that each individual backup is intact; for that, use \u003ca class=\"xref\" href=\"/docs/18/app-pgverifybackup.html\" title=\"pg_verifybackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_verifybackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eSince the output of \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e is a synthetic full backup, it can be used as an input to a future invocation of \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e. The synthetic full backup would be specified on the command line in lieu of the chain of backups from which it was reconstructed.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.6\"\u003e\n\u003ch2\u003eOptions\u003c/h2\u003e\n\u003cdiv class=\"variablelist\"\u003e\n\u003cdl class=\"variablelist\"\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-d\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--debug\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrint lots of debug logging output on \u003ccode class=\"filename\"\u003estderr\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-k\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--link\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e has completed.\u003c/p\u003e\n\u003cp\u003eRequires that the input backups and the output directory are in the same file system.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, hard links will still be created, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-n\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--dry-run\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eThe \u003ccode class=\"option\"\u003e-n\u003c/code\u003e/\u003ccode class=\"option\"\u003e--dry-run\u003c/code\u003e option instructs \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with \u003ccode class=\"option\"\u003e--debug\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-N\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eBy default, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will wait for all files to be written safely to disk. This option causes \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-o \u003cem class=\"replaceable\"\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--output=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eoutputdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eSpecifies the output directory to which the synthetic full backup should be written. Currently, this argument is required.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-T \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--tablespace-mapping=\u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e=\u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eRelocates the tablespace in directory \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e to \u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e during the backup. \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e is the absolute path of the tablespace as it exists in the final backup specified on the command line, and \u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign (\u003ccode class=\"literal\"\u003e=\u003c/code\u003e), precede that with a backslash. This option can be specified multiple times for multiple tablespaces.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--clone\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse efficient file cloning (also known as \u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003ereflinks\u003c/span\u003e”\u003c/span\u003e on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, file cloning will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003cp\u003eFile cloning is only supported on some operating systems and file systems. If it is selected but not supported, the \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with reflink support), and on macOS with APFS.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePerform regular file copy. This is the default. (See also \u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e, \u003ccode class=\"option\"\u003e--clone\u003c/code\u003e, and \u003ccode class=\"option\"\u003e-k\u003c/code\u003e/\u003ccode class=\"option\"\u003e--link\u003c/code\u003e.)\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eUse the \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e system call for efficient copying. On some file systems this gives results similar to \u003ccode class=\"option\"\u003e--clone\u003c/code\u003e, sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD.\u003c/p\u003e\n\u003cp\u003eIf a backup manifest is not available or does not contain checksum of the right type, \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e will be used to copy the file, but the file will be also read block-by-block for the checksum calculation.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--manifest-checksums=\u003cem class=\"replaceable\"\u003e\u003ccode\u003ealgorithm\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eLike \u003ca class=\"xref\" href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e, \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are \u003ccode class=\"literal\"\u003eNONE\u003c/code\u003e, \u003ccode class=\"literal\"\u003eCRC32C\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA224\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA256\u003c/code\u003e, \u003ccode class=\"literal\"\u003eSHA384\u003c/code\u003e, and \u003ccode class=\"literal\"\u003eSHA512\u003c/code\u003e. The default is \u003ccode class=\"literal\"\u003eCRC32C\u003c/code\u003e.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-manifest\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eDisables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--sync-method=\u003cem class=\"replaceable\"\u003e\u003ccode\u003emethod\u003c/code\u003e\u003c/em\u003e\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eWhen set to \u003ccode class=\"literal\"\u003efsync\u003c/code\u003e, which is the default, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace.\u003c/p\u003e\n\u003cp\u003eOn Linux, \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e may be used instead to ask the operating system to synchronize the whole file system that contains the backup directory. When the plain format is used, \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e will also synchronize the file systems that contain the WAL files and each tablespace. See \u003ca class=\"xref\" href=\"/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\"\u003erecovery_init_sync_method\u003c/a\u003e for information about the caveats to be aware of when using \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e.\u003c/p\u003e\n\u003cp\u003eThis option has no effect when \u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e is used.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-V\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--version\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003ePrints the \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e version and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e-?\u003c/code\u003e\u003cbr\u003e\u003c/span\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--help\u003c/code\u003e\u003c/span\u003e\u003c/dt\u003e\n\u003cdd\u003e\n\u003cp\u003eShows help about \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e command line arguments, and exits.\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"APP-PGCOMBINEBACKUP-LIMITATIONS\"\u003e\n\u003ch2\u003eLimitations\u003c/h2\u003e\n\u003cp\u003e\u003ccode class=\"literal\"\u003epg_combinebackup\u003c/code\u003e does not recompute page checksums when writing the output directory. Therefore, if any of the backups used for reconstruction were taken with checksums disabled, but the final backup was taken with checksums enabled, the resulting directory may contain pages with invalid checksums.\u003c/p\u003e\n\u003cp\u003eTo avoid this problem, taking a new full backup after changing the checksum state of the cluster using \u003ca class=\"xref\" href=\"/docs/18/app-pgchecksums.html\" title=\"pg_checksums\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_checksums\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e is recommended. Otherwise, you can disable and then optionally reenable checksums on the directory produced by \u003ccode class=\"literal\"\u003epg_combinebackup\u003c/code\u003e in order to correct the problem.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.8\"\u003e\n\u003ch2\u003eEnvironment\u003c/h2\u003e\n\u003cp\u003eThis utility, like most other \u003cspan class=\"productname\"\u003ePostgreSQL\u003c/span\u003e utilities, uses the environment variables supported by \u003cspan class=\"application\"\u003elibpq\u003c/span\u003e (see \u003ca class=\"xref\" href=\"/docs/18/libpq-envars.html\" title=\"32.15. Environment Variables\"\u003eSection 32.15\u003c/a\u003e).\u003c/p\u003e\n\u003cp\u003eThe environment variable \u003ccode class=\"envar\"\u003ePG_COLOR\u003c/code\u003e specifies whether to use color in diagnostic messages. Possible values are \u003ccode class=\"literal\"\u003ealways\u003c/code\u003e, \u003ccode class=\"literal\"\u003eauto\u003c/code\u003e and \u003ccode class=\"literal\"\u003enever\u003c/code\u003e.\u003c/p\u003e\n\u003c/div\u003e\n\u003cdiv class=\"refsect1\" id=\"id-1.9.4.12.9\"\u003e\n\u003ch2\u003eSee Also\u003c/h2\u003e\u003cspan class=\"simplelist\"\u003e\u003ca class=\"xref\" href=\"/docs/18/app-pgbasebackup.html\" title=\"pg_basebackup\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_basebackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/span\u003e\n\u003c/div\u003e\n\u003c/div\u003e\u003c/div\u003e","related":[],"sections":[],"tables":[{"columns":[{"key":"signature","label":"Option and arguments"},{"key":"summary","label":"Description"}],"key":"options","rows":[{"signature":{"text":"-d --debug","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Print lots of debug logging output on stderr ."},{"signature":{"text":"-k --link","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use hard links instead of copying files to the synthetic backup. Reconstruction of the synthetic backup might be faster (no file copying) and use less disk space, but care must be taken when using the output directory, because any modifications to that directory (for example, starting the server) can also affect the input directories. Likewise, changes to the input directories (for example, starting the server on the full backup) could affect the output directory. Thus, this option is best used when the input directories are only copies that will be removed after pg_combinebackup has completed."},{"signature":{"text":"-n --dry-run","url":"/docs/18/app-pgcombinebackup.html"},"summary":"The -n / --dry-run option instructs pg_combinebackup to figure out what would be done without actually creating the target directory or any output files. It is particularly useful in combination with --debug ."},{"signature":{"text":"-N --no-sync","url":"/docs/18/app-pgcombinebackup.html"},"summary":"By default, pg_combinebackup will wait for all files to be written safely to disk. This option causes pg_combinebackup to return without waiting, which is faster, but means that a subsequent operating system crash can leave the output backup corrupt. Generally, this option is useful for testing but should not be used when creating a production installation."},{"signature":{"text":"-o outputdir --output= outputdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Specifies the output directory to which the synthetic full backup should be written. Currently, this argument is required."},{"signature":{"text":"-T olddir = newdir --tablespace-mapping= olddir = newdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Relocates the tablespace in directory olddir to newdir during the backup. olddir is the absolute path of the tablespace as it exists in the final backup specified on the command line, and newdir is the absolute path to use for the tablespace in the reconstructed backup. If either path needs to contain an equal sign ( = ), precede that with a backslash. This option can be specified multiple times for multiple tablespaces."},{"signature":{"text":"--clone","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use efficient file cloning (also known as “ reflinks ” on some systems) instead of copying files to the new data directory, which can result in near-instantaneous copying of the data files."},{"signature":{"text":"--copy","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Perform regular file copy. This is the default. (See also --copy-file-range , --clone , and -k / --link .)"},{"signature":{"text":"--copy-file-range","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Use the copy_file_range system call for efficient copying. On some file systems this gives results similar to --clone , sharing physical disk blocks, while on others it may still copy blocks, but do so via an optimized path. At present, it is supported on Linux and FreeBSD."},{"signature":{"text":"--manifest-checksums= algorithm","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Like pg_basebackup , pg_combinebackup writes a backup manifest in the output directory. This option specifies the checksum algorithm that should be applied to each file included in the backup manifest. Currently, the available algorithms are NONE , CRC32C , SHA224 , SHA256 , SHA384 , and SHA512 . The default is CRC32C ."},{"signature":{"text":"--no-manifest","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Disables generation of a backup manifest. If this option is not specified, a backup manifest for the reconstructed backup will be written to the output directory."},{"signature":{"text":"--sync-method= method","url":"/docs/18/app-pgcombinebackup.html"},"summary":"When set to fsync , which is the default, pg_combinebackup will recursively open and synchronize all files in the backup directory. When the plain format is used, the search for files will follow symbolic links for the WAL directory and each configured tablespace."},{"signature":{"text":"-V --version","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Prints the pg_combinebackup version and exits."},{"signature":{"text":"-? --help","url":"/docs/18/app-pgcombinebackup.html"},"summary":"Shows help about pg_combinebackup command line arguments, and exits."}],"title":"Documented options"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
