You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS Ubuntu 20.04.4 LTS
Server PostgreSQL 13.7 (Ubuntu 13.7-1.pgdg20.04+1)
With the extension postgresql-13-partman/focal-pgdg,now 4.6.2-1.pgdg20.04+1 amd64
STEPS TO REPRODUCE
In order to reproduce this bug you need to have shared_preload_libraries='pg_partman_bgw' on postgresql.conf file.
This will add pg_partman_bgw.analyze parametter to the database (among many others)
And then run postgresql_info module (with postgreSQL running on default port and socket directory)
- name: Get detailed informations of PostgreSQLcommunity.postgresql.postgresql_info:
become_user: postgresbecome: yes
EXPECTED RESULTS
Module succed with all information about the instance of PostgreSQL
ACTUAL RESULTS
fatal: [target]: FAILED! => {
"changed": false
}
MSG:
Cannot execute SQL 'SHOW pg_partman_bgw.analyze': syntax error at or near "analyze"
LINE 1: SHOW pg_partman_bgw.analyze
OTHERS INFOMATIONS
SHOW pg_partman_bgw.analyze command raise an error but protected with brackets like that SHOW "pg_partman_bgw.analyze" doesn't, because the "analyse" keyword is protected.
I changed return self.__exec_sql("SHOW %s" % setting)[0][0] into return self.__exec_sql('SHOW "%s"' % setting)[0][0] in here and it doesn't raise any error upon execution, i think it could resolve the issue
The text was updated successfully, but these errors were encountered:
SUMMARY
Show command in postgresql_info is not protected by brackets, when a parameter contain a key word (like analyze), it raises an SQL syntax error.
ISSUE TYPE
COMPONENT NAME
Module postgresql_info (it sould be in this line here)
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
OS Ubuntu 20.04.4 LTS
Server PostgreSQL 13.7 (Ubuntu 13.7-1.pgdg20.04+1)
With the extension postgresql-13-partman/focal-pgdg,now 4.6.2-1.pgdg20.04+1 amd64
STEPS TO REPRODUCE
In order to reproduce this bug you need to have
shared_preload_libraries='pg_partman_bgw'
on postgresql.conf file.This will add
pg_partman_bgw.analyze
parametter to the database (among many others)And then run postgresql_info module (with postgreSQL running on default port and socket directory)
EXPECTED RESULTS
Module succed with all information about the instance of PostgreSQL
ACTUAL RESULTS
OTHERS INFOMATIONS
SHOW pg_partman_bgw.analyze
command raise an error but protected with brackets like thatSHOW "pg_partman_bgw.analyze"
doesn't, because the "analyse" keyword is protected.I changed
return self.__exec_sql("SHOW %s" % setting)[0][0]
intoreturn self.__exec_sql('SHOW "%s"' % setting)[0][0]
in here and it doesn't raise any error upon execution, i think it could resolve the issueThe text was updated successfully, but these errors were encountered: