hashicorp / terraform-provider-postgresql

As part of our introduction to self-service publishing in the Terraform Registry, this copy of the provider has been archived, and ownership has been transferred to active maintainers in the community. Please see the new location on the Terraform Registry: https://registry.terraform.io/providers/cyrilgdn/postgresql
https://github.com/cyrilgdn/terraform-provider-postgresql
Mozilla Public License 2.0
103 stars 79 forks source link

postgresql_role trying to revoke when it shouldn't, and failing #173

Open ghost opened 4 years ago

ghost commented 4 years ago

This issue was originally opened by @waynejnicklin as hashicorp/terraform#26257. It was migrated here as a result of the provider split. The original body of the issue is below.


I'm trying to add roles to the postgresql admin user that is created when the postgresql server is created in Azure.

The "plan" step looks correct:

~ roles = [ "azure_pg_admin",

However, when the "apply" step is run, the following error occurs:

2020-09-16T09:14:08.6061271Z �[1m�[31mError: �[0m�[0m�[1mcould not revoke role azure_pg_admin from postgresqldev: pq: must be superuser to perform revoke role azure_pg_admin on server owner�[0m

So the issue is that the "apply" is doing something different to what the "plan" is saying. It's trying to revoke a role (and failing because it's not a superuser), but it shouldn't be trying to revoke that role as there is no change for that role in the "plan" file.

waynejnicklin commented 4 years ago

When will this be merged and available to use? I tried it just now and get the error: "The provider provider.postgresql does not support resource type "postgresql_grant_role"."

Thanks, Wayne