postgresql_sequence: use query parameters with cursor object (#65787)
This commit is contained in:
parent
c5a42a9ac6
commit
24b1409667
3 changed files with 8 additions and 5 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- postgresql_sequence - use query parameters with cursor object (https://github.com/ansible/ansible/pull/65787).
|
|
@ -369,11 +369,12 @@ class Sequence(object):
|
||||||
"LEFT JOIN pg_namespace n ON n.oid = c.relnamespace "
|
"LEFT JOIN pg_namespace n ON n.oid = c.relnamespace "
|
||||||
"WHERE NOT pg_is_other_temp_schema(n.oid) "
|
"WHERE NOT pg_is_other_temp_schema(n.oid) "
|
||||||
"AND c.relkind = 'S'::\"char\" "
|
"AND c.relkind = 'S'::\"char\" "
|
||||||
"AND sequence_name = '%s' "
|
"AND sequence_name = %(name)s "
|
||||||
"AND sequence_schema = '%s'" % (self.name,
|
"AND sequence_schema = %(schema)s")
|
||||||
self.schema))
|
|
||||||
|
|
||||||
res = exec_sql(self, query, add_to_executed=False)
|
res = exec_sql(self, query,
|
||||||
|
query_params={'name': self.name, 'schema': self.schema},
|
||||||
|
add_to_executed=False)
|
||||||
|
|
||||||
if not res:
|
if not res:
|
||||||
self.exists = False
|
self.exists = False
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Initial CI tests of postgresql_sequence module
|
# Initial CI tests of postgresql_sequence module
|
||||||
- import_tasks: postgresql_sequence_initial.yml
|
- import_tasks: postgresql_sequence_initial.yml
|
||||||
when: postgres_version_resp.stdout is version('9.0', '>=')
|
when: postgres_version_resp.stdout is version('9.4', '>=')
|
||||||
|
|
Loading…
Reference in a new issue