Skip to content

Commit 869920c

Browse files
committed
Replace $1 notation in queries to %s as psycopg2 expects it
1 parent 7594a7e commit 869920c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

testgres/node.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def source_walsender(self):
210210
sql = """
211211
select pid
212212
from pg_catalog.pg_stat_replication
213-
where application_name = $1
213+
where application_name = %s
214214
"""
215215

216216
if not self.master:
@@ -322,7 +322,7 @@ def _create_recovery_conf(self, username, slot=None):
322322
res = con.execute("""
323323
select exists (
324324
select from pg_catalog.pg_replication_slots
325-
where slot_name = $1
325+
where slot_name = %s
326326
)
327327
""", slot)
328328

@@ -332,7 +332,7 @@ def _create_recovery_conf(self, username, slot=None):
332332

333333
# TODO: we should drop this slot after replica's cleanup()
334334
con.execute("""
335-
select pg_catalog.pg_create_physical_replication_slot($1)
335+
select pg_catalog.pg_create_physical_replication_slot(%s)
336336
""", slot)
337337

338338
line += "primary_slot_name={}\n".format(slot)

0 commit comments

Comments
 (0)