Skip to content

Commit 3cd69fb

Browse files
committed
relaxation of the requirement for calling the old pg_catalog.ptrack_version() function
1 parent 7eaac77 commit 3cd69fb

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

‎src/ptrack.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@ get_ptrack_version(PGconn *backup_conn, PGNodeInfo *nodeInfo)
7979
return;
8080
}
8181

82-
res_db = pgut_execute(backup_conn,
82+
/*
83+
* it's ok not to have permission to call this old function in PGPRO-11 version (ok_error = true)
84+
* see deprication notice https://postgrespro.com/docs/postgrespro/11/release-pro-11-9-1
85+
*/
86+
res_db = pgut_execute_extended(backup_conn,
8387
"SELECT pg_catalog.ptrack_version()",
84-
0, NULL);
88+
0, NULL, true, true);
8589
if (PQntuples(res_db) == 0)
8690
{
87-
/* TODO: Something went wrong, should we error out here? */
8891
PQclear(res_db);
92+
elog(WARNING, "Can't call pg_catalog.ptrack_version(), it is assumed that there is no ptrack extension installed.");
8993
return;
9094
}
9195
ptrack_version_str = PQgetvalue(res_db, 0, 0);

‎tests/helpers/ptrack_helpers.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,11 @@ def __init__(self, *args, **kwargs):
312312
self.ptrack = False
313313
if 'PG_PROBACKUP_PTRACK' in self.test_env:
314314
if self.test_env['PG_PROBACKUP_PTRACK'] == 'ON':
315-
self.ptrack = True
315+
if self.pg_config_version >= self.version_to_num('11.0'):
316+
self.ptrack = True
316317

317318
os.environ["PGAPPNAME"] = "pg_probackup"
318319

319-
if self.ptrack:
320-
self.assertGreaterEqual(
321-
self.pg_config_version,
322-
self.version_to_num('11.0'),
323-
"ptrack testing require PostgreSQL >= 11")
324-
325320
@property
326321
def pg_config_version(self):
327322
return self.version_to_num(

0 commit comments

Comments
 (0)