mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-19 08:51:25 -07:00
postgres: make interfaces of exec_sql clearer (#43)
(cherry picked from commit fb6583a15c1f7fd8e48f4f3ef214ed4e74c3d8c6)
This commit is contained in:
parent
07ecfc940c
commit
1c550cd4ef
10 changed files with 44 additions and 45 deletions
|
@ -192,19 +192,19 @@ class PgSlot(object):
|
|||
|
||||
self.changed = exec_sql(self, query,
|
||||
query_params={'name': self.name, 'i_reserve': immediately_reserve},
|
||||
ddl=True)
|
||||
return_bool=True)
|
||||
|
||||
elif kind == 'logical':
|
||||
query = "SELECT pg_create_logical_replication_slot(%(name)s, %(o_plugin)s)"
|
||||
self.changed = exec_sql(self, query,
|
||||
query_params={'name': self.name, 'o_plugin': output_plugin}, ddl=True)
|
||||
query_params={'name': self.name, 'o_plugin': output_plugin}, return_bool=True)
|
||||
|
||||
def drop(self):
|
||||
if not self.exists:
|
||||
return False
|
||||
|
||||
query = "SELECT pg_drop_replication_slot(%(name)s)"
|
||||
self.changed = exec_sql(self, query, query_params={'name': self.name}, ddl=True)
|
||||
self.changed = exec_sql(self, query, query_params={'name': self.name}, return_bool=True)
|
||||
|
||||
def __slot_exists(self):
|
||||
query = "SELECT slot_type FROM pg_replication_slots WHERE slot_name = %(name)s"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue