Skip to content

Commit

Permalink
Disable exclusive backup check in PostgreSQL 15 and later
Browse files Browse the repository at this point in the history
Exclusive backup functionality was removed in core commit 39969e2a
so we can and must avoid checking for exclusive backups.
  • Loading branch information
ibarwick committed Oct 17, 2022
1 parent 64228c5 commit f002cee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dbutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit f002cee

Please sign in to comment.