-
Notifications
You must be signed in to change notification settings - Fork 200
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_default_privileges schema provider error when assigning privileges #419
Comments
Hello, yesterday we encountered the same issue for table and sequence default privileges in our databases (Aurora PostgreSQL 14.6 and Aurora PostgreSQL 15.5). After doing some debugging here is what we found out: In the database logs we could see that the provider correctly executes the terraform-provider-postgresql/postgresql/resource_postgresql_default_privileges.go Lines 298 to 304 in f46ec22
After executing the To check the provisioned default privileges the terraform-provider-postgresql/postgresql/resource_postgresql_default_privileges.go Lines 231 to 248 in f46ec22
BUT, the SELECT to Because the SELECT is not returning any rows, terraform thinks that the actual new state differs from the planned new state. This results in the inconsistency mentioned in the supplied error message: But if you would provision default privileges that differ from the standard set (e.g. only USAGE for schemas) to the owner OR provision default privileges to any other role which is not the owner, it will work, as the SELECT correctly returns the expected privileges. Probably the correct way would be to fix this inside the provider (e.g. updating the However a workaround could be, to only provision the resource if the privileges differ from the standard set of the object type. Maybe as an additional note: As we are also using Aurora PostgreSQL it's probably worth to check if for native postgreSQL the behaviour is different. |
I can confirm the same behavior on a standard postgres Cloud SQL instance in GCP |
Hi there,
We're having issues when assigning default privileges on schema to a specific role. The provider returns an error related to a Root object that was present and now absent. Nothing changed between plan and apply operations.
Below all the details:
Terraform Version
Terraform v1.6.1
Affected Resource(s)
Please list the resources as a list, for example:
Expected Behavior
Should grant "custom-database-role" with privileges to use and create schemas on the specified database.
Actual Behavior
This is the output that we are getting back from the previous resource creation:
Steps to Reproduce
terraform apply
Important Factoids
This is running on AWS Aurora with 15.5 as engine version. At steady state we expect to have a custom schema whose owner will be "custom-database-role". The creation of the schema happens after the creation of the role and the assignmenet of deafult permissions.
Thanks in advance for your help/support :)
The text was updated successfully, but these errors were encountered: