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

fix postgresql_user_mapping on AWS RDS Aurora #274

Merged
merged 4 commits into from
Mar 18, 2023

Conversation

fabiopaiva
Copy link
Contributor

@fabiopaiva fabiopaiva commented Dec 20, 2022

AWS RDS Aurora doesn't allow reading user_mappings from pg_catalog.pg_user_mappings but allows from information_schema._pg_user_mappings, which contains the same information.
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Extensions.foreign-data-wrappers.html#postgresql-oracle-fdw.permissions

I also found another bug when the password contains = in it, so I changed the way it's mapping the options

fix #280

@fabiopaiva fabiopaiva changed the title fix: AWS RDS Aurora dosn't allow reading user_mappings from pg_catalo… fix: AWS RDS Aurora doesn't allow reading user_mappings from pg_catalo… Jan 12, 2023
Copy link
Owner

@cyrilgdn cyrilgdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder how it was working even on non-Azure Postgres as, unlike information_schema._pg_user_mappings, pg_user_mapping seems to return oid for usename and srvname 🤔

Anyway, fix seems good to me 👍 , just a comment on the split fix.

postgresql/resource_postgresql_user_mapping.go Outdated Show resolved Hide resolved
Co-authored-by: Cyril Gaudin <cyril.gaudin@gmail.com>
@cyrilgdn cyrilgdn changed the title fix: AWS RDS Aurora doesn't allow reading user_mappings from pg_catalo… fix postgresql_user_mapping on AWS RDS Aurora Mar 18, 2023
@cyrilgdn cyrilgdn merged commit 8c7f87e into cyrilgdn:master Mar 18, 2023
cyrilgdn pushed a commit that referenced this pull request Oct 19, 2024
#274 broke
support for GCP Cloud Postgres and perhaps other versions.

fix: #327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error updating user mapping options: pq: option "user" provided more than once
2 participants