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

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy