Skip to content

Commit 45be8b5

Browse files
authored
Merge pull request #21 from rtau-t24/master
Skip system_identifier check on PostgreSQL 9.5
2 parents 3fcdae0 + ee2b1a9 commit 45be8b5

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

src/backup.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -917,22 +917,25 @@ check_system_identifiers(void)
917917

918918
system_id_pgdata = get_system_identifier(pgdata);
919919

920-
res = pgut_execute(backup_conn,
920+
if (server_version < 90600) {
921+
// Skip match system_identifier between backup data directory and DB connection as
922+
// pg_control_system() exists only in 9.6 onwards
923+
} else {
924+
res = pgut_execute(backup_conn,
921925
"SELECT system_identifier FROM pg_control_system()",
922926
0, NULL, true);
923-
val = PQgetvalue(res, 0, 0);
924-
925-
if (!parse_uint64(val, &system_id_conn, 0))
926-
{
927+
val = PQgetvalue(res, 0, 0);
928+
if (!parse_uint64(val, &system_id_conn, 0))
929+
{
930+
PQclear(res);
931+
elog(ERROR, "%s is not system_identifier", val);
932+
}
927933
PQclear(res);
928-
elog(ERROR, "%s is not system_identifier", val);
929-
}
930-
PQclear(res);
931-
932-
if (system_id_conn != system_identifier)
933-
elog(ERROR, "Backup data directory was initialized for system id %ld, but connected instance system id is %ld",
934-
system_identifier, system_id_conn);
935934

935+
if (system_id_conn != system_identifier)
936+
elog(ERROR, "Backup data directory was initialized for system id %ld, but connected instance system id is %ld",
937+
system_identifier, system_id_conn);
938+
}
936939
if (system_id_pgdata != system_identifier)
937940
elog(ERROR, "Backup data directory was initialized for system id %ld, but target backup directory system id is %ld",
938941
system_identifier, system_id_pgdata);

0 commit comments

Comments
 (0)