-
Notifications
You must be signed in to change notification settings - Fork 79
Could not read role password from Postgres as connected user is not a SUPERUSER #77
Comments
Hi @jleeh ,
As the error is mentioning, you have to add Non-superuser role does not have the privileges to read password in Postgres. |
Hey @cyrilgdn, that's the issue. The user is a superuser. The user I'm using is the one created with the RDS cluster, and just before this error, that same user created extensions, which requires superuser. |
@jleeh Sorry, I read a bit too quickly your issue. But roles can't be |
No worries. So I'm going through the provider source at the read role password function: From looking at the logic, even if the password doesn't match on read then the password given as input is returned, no error is thrown if they don't match. If the configured user provider has superuser as false or with no login, then it just returns the password given again. It makes me think to why this even is done at all? In this case can't the password be returned rather than throwing an error? Or remove the password reading all together since it doesn't really do anything practical. Edit: If you agree, I'm happy to make the changes. |
I'm having the same issue. I'm trying to delete some postgres users and terraform doesn't let me because it tries to read the user password. I don't even care about the user password since they all use RDS_IAM authentication. This is still an issue, why was this closed? |
@jonasneves Did you set the |
Yes, if I set it to false I get " permission denied to reassign objects". |
For future readers, I was able to work around this issue by changing the state directly and manually removing the role from RDS.
|
Terraform Version
v0.11.13
Postgres provider: v0.3.0
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
Expected Behavior
The connected user is a superuser so the role should be created fine.
Actual Behavior
Reported user isn't a superuser when it is. Prior to the role creation, the same user creates extensions without issue.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
References
None
The text was updated successfully, but these errors were encountered: