Closed mdespriee closed 4 years ago
Hi @mdespriee ,
Thanks for opening this issue. I see what happens here, we need to check how to fix that. Meanwhile, there's a few possible workarounds.
You could (if it does not have other impact for you) alter the owner of the public schema to set it to postgres
(alter schema public owner to postgres
) instead of rdsadmin
.
Did you create this database with Terraform too?
When creating a database, the provider forces the use of template0
as template database where the owner of the schema public
is rdsadmin
. If you run CREATE DATABASE
manually it will use template1
by default where the owner of the schema public
is postgres
so postgres
user has all privileges.
So we create RDS databases with template = "template1"
to fix that. (We also try to understand why template0
has been set as the default value and if we can change it).
It should not fail anyway as it was working before even with rdsadmin
as owner so we'll see how to fix it.
I can confirm that I have the same issue in 1.7.0 whereas 1.6.0 worked great. I just rolled back to 1.6.0 👍
Our terraform scripts started failing just after your release of v1.7.0 of postgresql provider (we did not pin a version, that's now the case). It seems to be related to AWS RDS context.
I can't produce a small reproducible case right now, sorry. But here are the main elements:
The resource that fails:
That resource is already existing, but terraform wants to update it nevertheless and fails with the following error:
Note that
postgres
is our master user for the DB in RDS. It's not a postgresql superuser, because AWS. IIRCrdsadmin
is an internal user used by AWS to manage the instance (which is superuser).The role is defined as follows:
The DB:
The provider: