From f002ceeae67113eb5a13af3c91aa2b86bc324565 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Wed, 11 May 2022 15:25:38 +0900 Subject: [PATCH] Disable exclusive backup check in PostgreSQL 15 and later Exclusive backup functionality was removed in core commit 39969e2a so we can and must avoid checking for exclusive backups. --- dbutils.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dbutils.c b/dbutils.c index 791d7d7c..875a9697 100644 --- a/dbutils.c +++ b/dbutils.c @@ -2139,7 +2139,13 @@ server_in_exclusive_backup_mode(PGconn *conn) { BackupState backup_state = BACKUP_STATE_UNKNOWN; const char *sqlquery = "SELECT pg_catalog.pg_is_in_backup()"; - PGresult *res = PQexec(conn, sqlquery); + PGresult *res = NULL; + + /* Exclusive backup removed from PostgreSQL 15 */ + if (PQserverVersion(conn) >= 150000) + return BACKUP_STATE_NO_BACKUP; + + res = PQexec(conn, sqlquery); if (PQresultStatus(res) != PGRES_TUPLES_OK) {