Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bc6c302

Browse files
committed
Fix: primary_slot_name never actually was set
1 parent 3e5dbec commit bc6c302

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

testgres/backup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def spawn_replica(self, name=None, destroy=True, slot_name=None):
171171

172172
# Assign it a master and a recovery file (private magic)
173173
node._assign_master(self.original_node)
174-
node._create_recovery_conf(username=self.username)
174+
node._create_recovery_conf(username=self.username, slot_name=slot_name)
175175

176176
return node
177177

testgres/node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def _create_recovery_conf(self, username, slot_name=None):
209209
).format(conninfo)
210210

211211
if slot_name:
212-
line += "primary_slot_name={}\n".format()
212+
line += "primary_slot_name={}\n".format(slot_name)
213213

214214
self.append_conf(RECOVERY_CONF_FILE, line)
215215

@@ -872,7 +872,9 @@ def create_replication_slot(self, slot_name, dbname=None, username=None):
872872
dbname: database name
873873
username: database user name
874874
"""
875-
query = "select pg_create_physical_replication_slot('{}')".format(slot_name)
875+
query = (
876+
"select pg_create_physical_replication_slot('{}')"
877+
).format(slot_name)
876878

877879
self.execute(query=query,
878880
dbname=dbname or default_dbname(),

0 commit comments

Comments
 (0)