mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-01-07 13:40:17 +02:00
Merge pull request #21 from rtau-t24/master
Skip system_identifier check on PostgreSQL 9.5
This commit is contained in:
commit
45be8b5d7b
27
src/backup.c
27
src/backup.c
@ -917,22 +917,25 @@ check_system_identifiers(void)
|
||||
|
||||
system_id_pgdata = get_system_identifier(pgdata);
|
||||
|
||||
res = pgut_execute(backup_conn,
|
||||
if (server_version < 90600) {
|
||||
// Skip match system_identifier between backup data directory and DB connection as
|
||||
// pg_control_system() exists only in 9.6 onwards
|
||||
} else {
|
||||
res = pgut_execute(backup_conn,
|
||||
"SELECT system_identifier FROM pg_control_system()",
|
||||
0, NULL, true);
|
||||
val = PQgetvalue(res, 0, 0);
|
||||
|
||||
if (!parse_uint64(val, &system_id_conn, 0))
|
||||
{
|
||||
val = PQgetvalue(res, 0, 0);
|
||||
if (!parse_uint64(val, &system_id_conn, 0))
|
||||
{
|
||||
PQclear(res);
|
||||
elog(ERROR, "%s is not system_identifier", val);
|
||||
}
|
||||
PQclear(res);
|
||||
elog(ERROR, "%s is not system_identifier", val);
|
||||
|
||||
if (system_id_conn != system_identifier)
|
||||
elog(ERROR, "Backup data directory was initialized for system id %ld, but connected instance system id is %ld",
|
||||
system_identifier, system_id_conn);
|
||||
}
|
||||
PQclear(res);
|
||||
|
||||
if (system_id_conn != system_identifier)
|
||||
elog(ERROR, "Backup data directory was initialized for system id %ld, but connected instance system id is %ld",
|
||||
system_identifier, system_id_conn);
|
||||
|
||||
if (system_id_pgdata != system_identifier)
|
||||
elog(ERROR, "Backup data directory was initialized for system id %ld, but target backup directory system id is %ld",
|
||||
system_identifier, system_id_pgdata);
|
||||
|
Loading…
Reference in New Issue
Block a user