{"Entry":{"collection":"tool","key":"pg-combinebackup","name":"pg_combinebackup","aliases":["pg_combinebackup"],"metadata":{"aliases":["pg_combinebackup"],"category":"Client applications","content_hash":"258d84862b30064c6adfc374ea1e7fc829c0bc74e993ae5f31ae14e4d24a4531","derived_content_hash":"02cb90b3729a34e84560b1ea18002b66f16ae1530a5071dcc71aa3f572004a46","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"],"description_zh":"描述 pg_combinebackup 用于从 增量备份 及其所依赖的更早备份中重建一个合成的完整备份。 请在命令行上按照从旧到新的顺序指定所有必需的备份。也就是说，第一个备份目录应当是完整备份的路径，最后一个应当是您希望恢复的最终增量备份的路径。重建后的备份将写入由 -o 选项指定的输出目录。 pg_combinebackup 会尝试验证您指定的这些备份是否构成一条合法的备份链，并且能否据此重建出正确的完整备份。但它并不是为帮助您跟踪哪些备份依赖于哪些其他备份而设计的。如果您删除了增量备份所依赖的一个或多个先前备份，就无法恢复该增量备份。此外， pg_combinebackup 只会尝试验证这些备份相互之间的关系是否正确，而不会验证每个单独备份本身是否完好；如需完成该项验证，请使用 pg_verifybackup 。 由于 pg_combinebackup 的输出是一个合成完整备份，因此它可以作为将来调用 pg_combinebackup 时的输入。在这种情况下，可以在命令行上指定这个合成完整备份，以代替原先用于重建它的那条备份链。 选项 -d --debug 在 stderr 上输出大量调试日志。 -k --link 在合成备份中使用硬链接，而不是复制文件。这样重建合成备份可能更快（因为无需复制文件），并且占用更少磁盘空间；但在使用输出目录时必须格外小心，因为对该目录的任何修改（例如启动服务器）也可能影响输入目录。同样，对输入目录的更改（例如在完整备份上启动服务器）也可能影响输出目录。因此，此选项最适合输入目录只是副本、并且会在 pg_combinebackup 完成后被删除的场景。 要求输入备份和输出目录位于同一文件系统中。 如果备份清单不可用，或者其中不包含正确类型的校验和，仍会创建硬链接，但也会按块读取文件以计算校验和。 -n --dry-run -n / --dry-run 会让 pg_combinebackup 确定将要执行哪些操作，而不实际创建目标目录或任何输出文件。该选项与 --debug 组合时尤其有用。 -N --no-sync 默认情况下， pg","description_zh_html":"\u003cp\u003e命令行工具 pg_combinebackup [ option ...] [ backup_directory ...]。\u003c/p\u003e\u003ch3\u003e同版本中文手册节选\u003c/h3\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e描述\u003c/h2\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 用于从\u003ca class=\"link\" href=\"/zh/docs/18/continuous-archiving.html#BACKUP-INCREMENTAL-BACKUP\"\u003e增量备份\u003c/a\u003e及其所依赖的更早备份中重建一个合成的完整备份。\n  \u003c/p\u003e\u003cp\u003e\n   请在命令行上按照从旧到新的顺序指定所有必需的备份。也就是说，第一个备份目录应当是完整备份的路径，最后一个应当是您希望恢复的最终增量备份的路径。重建后的备份将写入由 \u003ccode class=\"option\"\u003e-o\u003c/code\u003e 选项指定的输出目录。\n  \u003c/p\u003e\u003cp\u003e\n\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 会尝试验证您指定的这些备份是否构成一条合法的备份链，并且能否据此重建出正确的完整备份。但它并不是为帮助您跟踪哪些备份依赖于哪些其他备份而设计的。如果您删除了增量备份所依赖的一个或多个先前备份，就无法恢复该增量备份。此外，\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 只会尝试验证这些备份相互之间的关系是否正确，而不会验证每个单独备份本身是否完好；如需完成该项验证，请使用 \u003ca class=\"xref\" href=\"/zh/docs/18/app-pgverifybackup.html\"\u003e\u003cspan class=\"refentrytitle\"\u003e\u003cspan class=\"application\"\u003epg_verifybackup\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e。\n  \u003c/p\u003e\u003cp\u003e\n   由于 \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 的输出是一个合成完整备份，因此它可以作为将来调用 \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 时的输入。在这种情况下，可以在命令行上指定这个合成完整备份，以代替原先用于重建它的那条备份链。\n  \u003c/p\u003e\u003c/div\u003e\u003cdiv class=\"refsect1\"\u003e\u003ch2\u003e选项\u003c/h2\u003e\u003cp\u003e\n\u003c/p\u003e\u003cdiv class=\"variablelist\"\u003e\u003cdl class=\"variablelist\"\u003e\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\u003cdd\u003e\u003cp\u003e\n        在 \u003ccode class=\"filename\"\u003estderr\u003c/code\u003e 上输出大量调试日志。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        在合成备份中使用硬链接，而不是复制文件。这样重建合成备份可能更快（因为无需复制文件），并且占用更少磁盘空间；但在使用输出目录时必须格外小心，因为对该目录的任何修改（例如启动服务器）也可能影响输入目录。同样，对输入目录的更改（例如在完整备份上启动服务器）也可能影响输出目录。因此，此选项最适合输入目录只是副本、并且会在\n        \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 完成后被删除的场景。\n       \u003c/p\u003e\u003cp\u003e\n        要求输入备份和输出目录位于同一文件系统中。\n       \u003c/p\u003e\u003cp\u003e\n        如果备份清单不可用，或者其中不包含正确类型的校验和，仍会创建硬链接，但也会按块读取文件以计算校验和。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n\u003ccode class=\"option\"\u003e-n\u003c/code\u003e/\u003ccode class=\"option\"\u003e--dry-run\u003c/code\u003e 会让\n        \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e 确定将要执行哪些操作，而不实际创建目标目录或任何输出文件。该选项与 \u003ccode class=\"option\"\u003e--debug\u003c/code\u003e 组合时尤其有用。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        默认情况下，\u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e 会等待所有文件都被安全写入磁盘。此选项会使 \u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e 不经等待就直接返回，因此速度更快，但这意味着如果随后操作系统崩溃，输出备份可能会损坏。通常，此选项适合测试，但不应用于创建生产环境安装。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        指定合成完整备份写入的输出目录。当前该参数是必需的。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        在重建备份期间，将目录 \u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e 中的表空间重定位到\n        \u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e。\u003cem class=\"replaceable\"\u003e\u003ccode\u003eolddir\u003c/code\u003e\u003c/em\u003e 是命令行指定的最终备份中该表空间的绝对路径，\u003cem class=\"replaceable\"\u003e\u003ccode\u003enewdir\u003c/code\u003e\u003c/em\u003e 是重建备份中要使用的绝对路径。若路径中需要包含等号（\u003ccode class=\"literal\"\u003e=\u003c/code\u003e），请在其前加反斜杠。可多次指定此选项以映射多个表空间。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--clone\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        使用高效的文件克隆（某些系统将其称为\u003cspan class=\"quote\"\u003e“\u003cspan class=\"quote\"\u003ereflink\u003c/span\u003e”\u003c/span\u003e），代替向新数据目录复制文件，这样可能实现几乎瞬时的数据文件复制。\n       \u003c/p\u003e\u003cp\u003e\n        如果备份清单不可用，或者其中不包含正确类型的校验和，仍会使用文件克隆来复制文件，但也会按块读取该文件以计算校验和。\n       \u003c/p\u003e\u003cp\u003e\n        文件克隆仅在某些操作系统和文件系统上受支持。如果选择了该选项，但系统并不支持，\u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 运行时将报错。目前，它在 Linux（内核 4.5 及以上）上的 Btrfs 和 XFS（在创建时启用了 reflink 支持的文件系统）以及 macOS 上的 APFS\n        上受支持。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        执行常规文件复制。这是默认行为。（另见 \u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e、\u003ccode class=\"option\"\u003e--clone\u003c/code\u003e\n        和 \u003ccode class=\"option\"\u003e-k\u003c/code\u003e/\u003ccode class=\"option\"\u003e--link\u003c/code\u003e。）\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--copy-file-range\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        使用 \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e 系统调用进行高效复制。在某些文件系统上，这会得到与 \u003ccode class=\"option\"\u003e--clone\u003c/code\u003e 类似的结果，即共享物理磁盘块；而在其他文件系统上，它仍可能复制数据块，但会通过优化后的路径进行。目前支持 Linux 和 FreeBSD。\n       \u003c/p\u003e\u003cp\u003e\n        如果备份清单不可用，或者其中不包含正确类型的校验和，仍会使用 \u003ccode class=\"function\"\u003ecopy_file_range\u003c/code\u003e 复制文件，但也会按块读取该文件以计算校验和。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        与 \u003ca class=\"xref\" href=\"/zh/docs/18/app-pgbasebackup.html\"\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 会在输出目录中写入备份清单。此选项指定对清单中每个文件使用的校验和算法。当前可用算法为 \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 和 \u003ccode class=\"literal\"\u003eSHA512\u003c/code\u003e。默认值为 \u003ccode class=\"literal\"\u003eCRC32C\u003c/code\u003e。\n       \u003c/p\u003e\u003c/dd\u003e\u003cdt\u003e\u003cspan class=\"term\"\u003e\u003ccode class=\"option\"\u003e--no-manifest\u003c/code\u003e\u003c/span\u003e \u003c/dt\u003e\u003cdd\u003e\u003cp\u003e\n        禁用备份清单的生成。若未指定该选项，则会将重建备份的清单写入输出目录。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        当设置为 \u003ccode class=\"literal\"\u003efsync\u003c/code\u003e（这是默认值）时，\u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e 会递归打开并同步备份目录中的所有文件。使用普通文件格式时，搜索文件时会跟随 WAL 目录和每个已配置表空间的符号链接。\n       \u003c/p\u003e\u003cp\u003e\n        在 Linux 上，也可以改用 \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e，让操作系统同步包含备份目录的整个文件系统。使用普通文件格式时，\u003ccode class=\"command\"\u003epg_combinebackup\u003c/code\u003e\n        还会同步包含 WAL 文件和各表空间的文件系统。关于使用 \u003ccode class=\"literal\"\u003esyncfs\u003c/code\u003e 时需要注意的事项，请参见 \u003ca class=\"xref\" href=\"/zh/docs/18/runtime-config-error-handling.html#GUC-RECOVERY-INIT-SYNC-METHOD\"\u003erecovery_init_sync_method\u003c/a\u003e。\n       \u003c/p\u003e\u003cp\u003e\n        使用 \u003ccode class=\"option\"\u003e--no-sync\u003c/code\u003e 时，此选项无效。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        打印 \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 版本并退出。\n       \u003c/p\u003e\u003c/dd\u003e\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\u003cdd\u003e\u003cp\u003e\n        显示 \u003cspan class=\"application\"\u003epg_combinebackup\u003c/span\u003e 命令行参数帮助并退出。\n       \u003c/p\u003e\u003c/dd\u003e\u003c/dl\u003e\u003c/div\u003e\u003cp\u003e\n\u003c/p\u003e\u003c/div\u003e\u003cp\u003e\u003ca href=\"/zh/docs/18/app-pgcombinebackup.html\"\u003e查看完整中文手册与上下文\u003c/a\u003e。\u003c/p\u003e","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"}],"facts_zh":[{"label":"手册中的可执行程序","value":"pg_combinebackup"},{"label":"程序版本","value":"18.6"},{"label":"参考清单","value":"客户端程序"},{"label":"选项定义组","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":[],"sections_zh":[],"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"}],"tables_zh":[{"columns":[{"key":"signature","label":"选项与参数"},{"key":"summary","label":"说明"}],"key":"options","rows":[{"signature":{"text":"-d --debug","url":"/docs/18/app-pgcombinebackup.html"},"summary":"在 stderr 上输出大量调试日志。"},{"signature":{"text":"-k --link","url":"/docs/18/app-pgcombinebackup.html"},"summary":"在合成备份中使用硬链接，而不是复制文件。这样重建合成备份可能更快（因为无需复制文件），并且占用更少磁盘空间；但在使用输出目录时必须格外小心，因为对该目录的任何修改（例如启动服务器）也可能影响输入目录。同样，对输入目录的更改（例如在完整备份上启动服务器）也可能影响输出目录。因此，此选项最适合输入目录只是副本、并且会在 pg_combinebackup 完成后被删除的场景。"},{"signature":{"text":"-n --dry-run","url":"/docs/18/app-pgcombinebackup.html"},"summary":"-n / --dry-run 会让 pg_combinebackup 确定将要执行哪些操作，而不实际创建目标目录或任何输出文件。该选项与 --debug 组合时尤其有用。"},{"signature":{"text":"-N --no-sync","url":"/docs/18/app-pgcombinebackup.html"},"summary":"默认情况下， pg_combinebackup 会等待所有文件都被安全写入磁盘。此选项会使 pg_combinebackup 不经等待就直接返回，因此速度更快，但这意味着如果随后操作系统崩溃，输出备份可能会损坏。通常，此选项适合测试，但不应用于创建生产环境安装。"},{"signature":{"text":"-o outputdir --output= outputdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"指定合成完整备份写入的输出目录。当前该参数是必需的。"},{"signature":{"text":"-T olddir = newdir --tablespace-mapping= olddir = newdir","url":"/docs/18/app-pgcombinebackup.html"},"summary":"在重建备份期间，将目录 olddir 中的表空间重定位到 newdir 。 olddir 是命令行指定的最终备份中该表空间的绝对路径， newdir 是重建备份中要使用的绝对路径。若路径中需要包含等号（ = ），请在其前加反斜杠。可多次指定此选项以映射多个表空间。"},{"signature":{"text":"--clone","url":"/docs/18/app-pgcombinebackup.html"},"summary":"使用高效的文件克隆（某些系统将其称为 “ reflink ” ），代替向新数据目录复制文件，这样可能实现几乎瞬时的数据文件复制。"},{"signature":{"text":"--copy","url":"/docs/18/app-pgcombinebackup.html"},"summary":"执行常规文件复制。这是默认行为。（另见 --copy-file-range 、 --clone 和 -k / --link 。）"},{"signature":{"text":"--copy-file-range","url":"/docs/18/app-pgcombinebackup.html"},"summary":"使用 copy_file_range 系统调用进行高效复制。在某些文件系统上，这会得到与 --clone 类似的结果，即共享物理磁盘块；而在其他文件系统上，它仍可能复制数据块，但会通过优化后的路径进行。目前支持 Linux 和 FreeBSD。"},{"signature":{"text":"--manifest-checksums= algorithm","url":"/docs/18/app-pgcombinebackup.html"},"summary":"与 pg_basebackup 一样， pg_combinebackup 会在输出目录中写入备份清单。此选项指定对清单中每个文件使用的校验和算法。当前可用算法为 NONE 、 CRC32C 、 SHA224 、 SHA256 、 SHA384 和 SHA512 。默认值为 CRC32C 。"},{"signature":{"text":"--no-manifest","url":"/docs/18/app-pgcombinebackup.html"},"summary":"禁用备份清单的生成。若未指定该选项，则会将重建备份的清单写入输出目录。"},{"signature":{"text":"--sync-method= method","url":"/docs/18/app-pgcombinebackup.html"},"summary":"当设置为 fsync （这是默认值）时， pg_combinebackup 会递归打开并同步备份目录中的所有文件。使用普通文件格式时，搜索文件时会跟随 WAL 目录和每个已配置表空间的符号链接。"},{"signature":{"text":"-V --version","url":"/docs/18/app-pgcombinebackup.html"},"summary":"打印 pg_combinebackup 版本并退出。"},{"signature":{"text":"-? --help","url":"/docs/18/app-pgcombinebackup.html"},"summary":"显示 pg_combinebackup 命令行参数帮助并退出。"}],"title":"手册中的选项"}],"zh_from":{"authored_translation":"source-derived-identity","body_sha256":"56beaf3977808f81f47c6f3b8191b52485b28f832d35439f363737eb07ff9f7e","kind":"same-version-chinese-manual-with-source-derived-identity","manual":{"anchor":"","build_id":107,"extraction":"command-description-and-options","fragment_sha256":"8c29993e4e3f230d229e9e46d62ace1bd8d91ff29ffe166b154b196f0392f012","locale":"zh-Hans","page_key":"app-pgcombinebackup.html","source_hash":"e3b205a1686be4fdcdadb0806c2b829b96b11bdaa3e0c55c0b1b39817ac02c77","source_revision":"unknown:rendered-translation-baseline","translated_from_revision":null,"translation_revision":"git:b1b500221dbe5437cfca004d6b04d3f6e422765d;html-sha256:08e987a66af27b98444a8057c256314eafa13611a3fb9e888214fc436824244b","url":"/zh/docs/18/app-pgcombinebackup.html","version":"18"},"runtime_rerun":false,"source_facts_revision":"ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8"}},"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":"en","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
