Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #344/7ae4f459 backport][stable-1] fix(postgresql_info): properly quote args to SHOW to avoid triggering 'reserved word' errors #346

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- postgresql_info - make arguments passed to SHOW command properly quoted to prevent the interpreter evaluating them (https://github.com/ansible-collections/community.postgresql/issues/314).
2 changes: 1 addition & 1 deletion plugins/modules/postgresql_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ def get_db_info(self):

def __get_pretty_val(self, setting):
"""Get setting's value represented by SHOW command."""
return self.__exec_sql("SHOW %s" % setting)[0][0]
return self.__exec_sql('SHOW "%s"' % setting)[0][0]

def __exec_sql(self, query):
"""Execute SQL and return the result."""
Expand Down