Skip to content

Commit f5fe963

Browse files
committed
Use pg_is_in_recovery() instead of relying on transaction_read_only GUC variable in promote() func
1 parent 4f2b77d commit f5fe963

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

testgres/node.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,11 @@ def promote(self, dbname=None, username=None):
713713
# for versions below 10 `promote` is asynchronous so we need to wait
714714
# until it actually becomes writable
715715
if self._pg_version < '10':
716-
check_query = "SHOW transaction_read_only"
716+
check_query = "SELECT pg_is_in_recovery()"
717717

718718
self.poll_query_until(
719719
query=check_query,
720-
expected="off",
720+
expected=False,
721721
dbname=dbname,
722722
username=username,
723723
max_attempts=0) # infinite

0 commit comments

Comments
 (0)