Skip to content
Next Next commit
[PBCKP-232] remove 9.5-9.6 support, part 1
  • Loading branch information
kulaginm committed Jul 19, 2022
commit 822111e278afb1318a9ae98cab954f971129606c
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ env:
jobs:
allow_failures:
- if: env(PG_BRANCH) = master
- if: env(PG_BRANCH) = REL9_6_STABLE
- if: env(PG_BRANCH) = REL9_5_STABLE
# - if: env(MODE) IN (archive, backup, delta, locking, merge, replica, retention, restore)

Expand Down
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
`pg_probackup` is a utility to manage backup and recovery of PostgreSQL database clusters. It is designed to perform periodic backups of the PostgreSQL instance that enable you to restore the server in case of a failure.

The utility is compatible with:
* PostgreSQL 9.6, 10, 11, 12, 13, 14;
* PostgreSQL 10, 11, 12, 13, 14;

As compared to other backup solutions, `pg_probackup` offers the following benefits that can help you implement different backup strategies and deal with large amounts of data:
* Incremental backup: page-level incremental backup allows you to save disk space, speed up backup and restore. With three different incremental modes, you can plan the backup strategy in accordance with your data flow.
Expand Down Expand Up @@ -74,109 +74,109 @@ Installers are available in release **assets**. [Latests](https://github.com/pos
#DEB Ubuntu|Debian Packages
sudo sh -c 'echo "deb [arch=amd64] https://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" > /etc/apt/sources.list.d/pg_probackup.list'
sudo wget -O - https://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
sudo apt-get install pg-probackup-{14,13,12,11,10,9.6}
sudo apt-get install pg-probackup-{14,13,12,11,10,9.6}-dbg
sudo apt-get install pg-probackup-{14,13,12,11,10}
sudo apt-get install pg-probackup-{14,13,12,11,10}-dbg

#DEB-SRC Packages
sudo sh -c 'echo "deb-src [arch=amd64] https://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >>\
/etc/apt/sources.list.d/pg_probackup.list' && sudo apt-get update
sudo apt-get source pg-probackup-{14,13,12,11,10,9.6}
sudo apt-get source pg-probackup-{14,13,12,11,10}

#DEB Astra Linix Orel
sudo sh -c 'echo "deb [arch=amd64] https://repo.postgrespro.ru/pg_probackup/deb/ stretch main-stretch" > /etc/apt/sources.list.d/pg_probackup.list'
sudo wget -O - https://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
sudo apt-get install pg-probackup-{14,13,12,11,10,9.6}{-dbg,}
sudo apt-get install pg-probackup-{14,13,12,11,10}{-dbg,}

#RPM Centos Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-centos.noarch.rpm
yum install pg_probackup-{14,13,12,11,10,9.6}
yum install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{14,13,12,11,10}
yum install pg_probackup-{14,13,12,11,10}-debuginfo

#RPM RHEL Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-rhel.noarch.rpm
yum install pg_probackup-{14,13,12,11,10,9.6}
yum install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{14,13,12,11,10}
yum install pg_probackup-{14,13,12,11,10}-debuginfo

#RPM Oracle Linux Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-oraclelinux.noarch.rpm
yum install pg_probackup-{14,13,12,11,10,9.6}
yum install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{14,13,12,11,10}
yum install pg_probackup-{14,13,12,11,10}-debuginfo

#SRPM Centos|RHEL|OracleLinux Packages
yumdownloader --source pg_probackup-{14,13,12,11,10,9.6}
yumdownloader --source pg_probackup-{14,13,12,11,10}

#RPM SUSE|SLES Packages
zypper install --allow-unsigned-rpm -y https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-suse.noarch.rpm
zypper --gpg-auto-import-keys install -y pg_probackup-{14,13,12,11,10,9.6}
zypper install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
zypper --gpg-auto-import-keys install -y pg_probackup-{14,13,12,11,10}
zypper install pg_probackup-{14,13,12,11,10}-debuginfo

#SRPM SUSE|SLES Packages
zypper si pg_probackup-{14,13,12,11,10,9.6}
zypper si pg_probackup-{14,13,12,11,10}

#RPM ALT Linux 7
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list'
sudo apt-get update
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{14,13,12,11,10}
sudo apt-get install pg_probackup-{14,13,12,11,10}-debuginfo

#RPM ALT Linux 8
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p8 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list'
sudo apt-get update
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{14,13,12,11,10}
sudo apt-get install pg_probackup-{14,13,12,11,10}-debuginfo

#RPM ALT Linux 9
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p9 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list'
sudo apt-get update
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}
sudo apt-get install pg_probackup-{14,13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{14,13,12,11,10}
sudo apt-get install pg_probackup-{14,13,12,11,10}-debuginfo
```

#### pg_probackup for PostgresPro Standard and Enterprise
```shell
#DEB Ubuntu|Debian Packages
sudo sh -c 'echo "deb [arch=amd64] https://repo.postgrespro.ru/pg_probackup-forks/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" > /etc/apt/sources.list.d/pg_probackup-forks.list'
sudo wget -O - https://repo.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
sudo apt-get install pg-probackup-{std,ent}-{13,12,11,10,9.6}
sudo apt-get install pg-probackup-{std,ent}-{13,12,11,10,9.6}-dbg
sudo apt-get install pg-probackup-{std,ent}-{13,12,11,10}
sudo apt-get install pg-probackup-{std,ent}-{13,12,11,10}-dbg

#DEB Astra Linix Orel
sudo sh -c 'echo "deb [arch=amd64] https://repo.postgrespro.ru/pg_probackup-forks/deb/ stretch main-stretch" > /etc/apt/sources.list.d/pg_probackup.list'
sudo wget -O - https://repo.postgrespro.ru/pg_probackup-forks/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
sudo apt-get install pg-probackup-{std,ent}-{12,11,10,9.6}{-dbg,}
sudo apt-get install pg-probackup-{std,ent}-{12,11,10}{-dbg,}


#RPM Centos Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup-forks/keys/pg_probackup-repo-forks-centos.noarch.rpm
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{std,ent}-{13,12,11,10}
yum install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo

#RPM RHEL Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup-forks/keys/pg_probackup-repo-forks-rhel.noarch.rpm
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{std,ent}-{13,12,11,10}
yum install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo

#RPM Oracle Linux Packages
rpm -ivh https://repo.postgrespro.ru/pg_probackup-forks/keys/pg_probackup-repo-forks-oraclelinux.noarch.rpm
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}
yum install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
yum install pg_probackup-{std,ent}-{13,12,11,10}
yum install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo

#RPM ALT Linux 7
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup-forks/rpm/latest/altlinux-p7 x86_64 forks" > /etc/apt/sources.list.d/pg_probackup_forks.list'
sudo apt-get update
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo

#RPM ALT Linux 8
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup-forks/rpm/latest/altlinux-p8 x86_64 forks" > /etc/apt/sources.list.d/pg_probackup_forks.list'
sudo apt-get update
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo

#RPM ALT Linux 9
sudo sh -c 'echo "rpm https://repo.postgrespro.ru/pg_probackup-forks/rpm/latest/altlinux-p9 x86_64 forks" > /etc/apt/sources.list.d/pg_probackup_forks.list' && sudo apt-get update
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10,9.6}-debuginfo
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}
sudo apt-get install pg_probackup-{std,ent}-{13,12,11,10}-debuginfo
```

Once you have `pg_probackup` installed, complete [the setup](https://postgrespro.github.io/pg_probackup/#pbk-install-and-setup).
Expand Down
10 changes: 0 additions & 10 deletions src/backup.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
pg_start_backup(label, smooth_checkpoint, &current, nodeInfo, backup_conn);

/* Obtain current timeline */
#if PG_VERSION_NUM >= 90600
current.tli = get_current_timeline(backup_conn);
#else
/* PG-9.5 */
current.tli = get_current_timeline_from_control(FIO_DB_HOST, instance_config.pgdata, false);
#endif

/*
* In incremental backup mode ensure that already-validated
Expand Down Expand Up @@ -1053,7 +1048,6 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup,

/*
* Switch to a new WAL segment. It should be called only for master.
* For PG 9.5 it should be called only if pguser is superuser.
*/
void
pg_switch_wal(PGconn *conn)
Expand All @@ -1062,11 +1056,7 @@ pg_switch_wal(PGconn *conn)

pg_silent_client_messages(conn);

#if PG_VERSION_NUM >= 100000
res = pgut_execute(conn, "SELECT pg_catalog.pg_switch_wal()", 0, NULL);
#else
res = pgut_execute(conn, "SELECT pg_catalog.pg_switch_xlog()", 0, NULL);
#endif

PQclear(res);
}
Expand Down
8 changes: 0 additions & 8 deletions src/catchup.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ catchup_init_state(PGNodeInfo *source_node_info, const char *source_pgdata, cons
source_node_info->is_ptrack_enabled = pg_is_ptrack_enabled(source_conn, source_node_info->ptrack_version_num);

/* Obtain current timeline */
#if PG_VERSION_NUM >= 90600
current.tli = get_current_timeline(source_conn);
#else
/* PG-9.5 */
instance_config.pgdata = source_pgdata;
current.tli = get_current_timeline_from_control(FIO_DB_HOST, source_pgdata, false);
#endif

elog(INFO, "Catchup start, pg_probackup version: %s, "
"PostgreSQL version: %s, "
Expand Down Expand Up @@ -1033,7 +1027,6 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
if (!dry_run)
wait_wal_and_calculate_stop_lsn(dest_xlog_path, stop_backup_result.lsn, &current);

#if PG_VERSION_NUM >= 90600
/* Write backup_label */
Assert(stop_backup_result.backup_label_content != NULL);
if (!dry_run)
Expand Down Expand Up @@ -1061,7 +1054,6 @@ do_catchup(const char *source_pgdata, const char *dest_pgdata, int num_threads,
stop_backup_result.tablespace_map_content = NULL;
stop_backup_result.tablespace_map_content_len = 0;
}
#endif

/* wait for end of wal streaming and calculate wal size transfered */
if (!dry_run)
Expand Down
5 changes: 0 additions & 5 deletions src/parsexlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@
* RmgrNames is an array of resource manager names, to make error messages
* a bit nicer.
*/
#if PG_VERSION_NUM >= 100000
#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup,mask) \
name,
#else
#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup) \
name,
#endif

static const char *RmgrNames[RM_MAX_ID + 1] = {
#include "access/rmgrlist.h"
Expand Down
7 changes: 1 addition & 6 deletions src/pg_probackup.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ pid_t my_pid = 0;
__thread int my_thread_num = 1;
bool progress = false;
bool no_sync = false;
#if PG_VERSION_NUM >= 100000
char *replication_slot = NULL;
bool temp_slot = false;
#endif
bool perm_slot = false;

/* backup options */
Expand Down Expand Up @@ -205,9 +203,7 @@ static ConfigOption cmd_options[] =
{ 'f', 'b', "backup-mode", opt_backup_mode, SOURCE_CMD_STRICT },
{ 'b', 'C', "smooth-checkpoint", &smooth_checkpoint, SOURCE_CMD_STRICT },
{ 's', 'S', "slot", &replication_slot, SOURCE_CMD_STRICT },
#if PG_VERSION_NUM >= 100000
{ 'b', 181, "temp-slot", &temp_slot, SOURCE_CMD_STRICT },
#endif
{ 'b', 'P', "perm-slot", &perm_slot, SOURCE_CMD_STRICT },
{ 'b', 182, "delete-wal", &delete_wal, SOURCE_CMD_STRICT },
{ 'b', 183, "delete-expired", &delete_expired, SOURCE_CMD_STRICT },
Expand Down Expand Up @@ -905,14 +901,13 @@ main(int argc, char *argv[])
wal_file_name, instanceState->instance_name, instance_config.system_identifier, system_id);
}

#if PG_VERSION_NUM >= 100000
if (temp_slot && perm_slot)
elog(ERROR, "You cannot specify \"--perm-slot\" option with the \"--temp-slot\" option");

/* if slot name was not provided for temp slot, use default slot name */
if (!replication_slot && temp_slot)
replication_slot = DEFAULT_TEMP_SLOT_NAME;
#endif

if (!replication_slot && perm_slot)
replication_slot = DEFAULT_PERMANENT_SLOT_NAME;

Expand Down
8 changes: 0 additions & 8 deletions src/pg_probackup.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,8 @@ extern const char *PROGRAM_EMAIL;
#define DATABASE_DIR "database"
#define BACKUPS_DIR "backups"
#define WAL_SUBDIR "wal"
#if PG_VERSION_NUM >= 100000
#define PG_XLOG_DIR "pg_wal"
#define PG_LOG_DIR "log"
#else
#define PG_XLOG_DIR "pg_xlog"
#define PG_LOG_DIR "pg_log"
#endif
#define PG_TBLSPC_DIR "pg_tblspc"
#define PG_GLOBAL_DIR "global"
#define BACKUP_CONTROL_FILE "backup.control"
Expand Down Expand Up @@ -777,11 +772,8 @@ extern bool stream_wal;
extern bool show_color;
extern bool progress;
extern bool is_archive_cmd; /* true for archive-{get,push} */
/* In pre-10 'replication_slot' is defined in receivelog.h */
extern char *replication_slot;
#if PG_VERSION_NUM >= 100000
extern bool temp_slot;
#endif
extern bool perm_slot;

/* backup options */
Expand Down
Loading