diff options
author | Robert Haas <rhaas@postgresql.org> | 2023-12-20 09:49:12 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2023-12-20 09:49:12 -0500 |
commit | dc212340058b4e7ecfc5a7a81ec50e7a207bf288 (patch) | |
tree | 79ffec15f6a8d9fce1333b99dd0b587e2459d38f /src/bin/pg_combinebackup/reconstruct.h | |
parent | 174c480508ac25568561443e6d4a82d5c1103487 (diff) |
Add support for incremental backup.
To take an incremental backup, you use the new replication command
UPLOAD_MANIFEST to upload the manifest for the prior backup. This
prior backup could either be a full backup or another incremental
backup. You then use BASE_BACKUP with the INCREMENTAL option to take
the backup. pg_basebackup now has an --incremental=PATH_TO_MANIFEST
option to trigger this behavior.
An incremental backup is like a regular full backup except that
some relation files are replaced with files with names like
INCREMENTAL.${ORIGINAL_NAME}, and the backup_label file contains
additional lines identifying it as an incremental backup. The new
pg_combinebackup tool can be used to reconstruct a data directory
from a full backup and a series of incremental backups.
Patch by me. Reviewed by Matthias van de Meent, Dilip Kumar, Jakub
Wartak, Peter Eisentraut, and Álvaro Herrera. Thanks especially to
Jakub for incredibly helpful and extensive testing.
Discussion: http://postgr.es/m/CA+TgmoYOYZfMCyOXFyC-P+-mdrZqm5pP2N7S-r0z3_402h9rsA@mail.gmail.com
Diffstat (limited to 'src/bin/pg_combinebackup/reconstruct.h')
-rw-r--r-- | src/bin/pg_combinebackup/reconstruct.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bin/pg_combinebackup/reconstruct.h b/src/bin/pg_combinebackup/reconstruct.h new file mode 100644 index 00000000000..d689aeb5c20 --- /dev/null +++ b/src/bin/pg_combinebackup/reconstruct.h @@ -0,0 +1,33 @@ +/*------------------------------------------------------------------------- + * + * reconstruct.h + * Reconstruct full file from incremental file and backup chain. + * + * Copyright (c) 2017-2023, PostgreSQL Global Development Group + * + * IDENTIFICATION + * src/bin/pg_combinebackup/reconstruct.h + * + *------------------------------------------------------------------------- + */ +#ifndef RECONSTRUCT_H +#define RECONSTRUCT_H + +#include "common/checksum_helper.h" +#include "load_manifest.h" + +extern void reconstruct_from_incremental_file(char *input_filename, + char *output_filename, + char *relative_path, + char *bare_file_name, + int n_prior_backups, + char **prior_backup_dirs, + manifest_data **manifests, + char *manifest_path, + pg_checksum_type checksum_type, + int *checksum_length, + uint8 **checksum_payload, + bool debug, + bool dry_run); + +#endif |