generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 80
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
postgresql_info fails when extracting databases as a non-superuser #429
Comments
HauserV
changed the title
postgresql_info does not work for non-superusers
postgresql_info fails when extracting databases as a non-superuser
Mar 9, 2023
@HauserV hello, sorry for the late response, was on PTO. Thanks for opening the issue, the point sounds fair. |
@Andersson007 Hello. I can take this task. |
closed via #437 Thanks everyone! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SUMMARY
Module
postgresql_info
fails to extract "databases" info when using a non-superuser login because the superuser privilege is required to access thesubconninfo
column inpg_catalog.pg_subscription
.ISSUE TYPE
COMPONENT NAME
postgresql_info
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
There is nothing but comments in
/etc/ansible/ansible.cfg
, though.OS / ENVIRONMENT
The database is managed by an external team (DBaaS) and I don't have superuser access.
STEPS TO REPRODUCE
EXPECTED RESULTS
The playbook should execute without errors.
ACTUAL RESULTS
The module attempts to fetch all columns (note the
s.*
) frompg_catalog.pg_subscription
via the following select and fails.community.postgresql/plugins/modules/postgresql_info.py
Lines 685 to 692 in 04c04c4
POSSIBLE SOLUTION
One could use the
information_schema
to identify columns available to the current user (i.e., all exceptsubconninfo
in our case) and select only those.The text was updated successfully, but these errors were encountered: