I am trying to grant a service account with -
in postgres. Google Cloud service accounts are setup like user-action@project-environment
.
so far I tried:
ALTER USER '[email protected]' WITH REPLICATION;
ALTER USER "[email protected]" WITH REPLICATION;
ALTER USER [email protected] WITH REPLICATION;
Not sure what the solution is.
I am trying to grant a service account with -
in postgres. Google Cloud service accounts are setup like user-action@project-environment
.
so far I tried:
ALTER USER '[email protected]' WITH REPLICATION;
ALTER USER "[email protected]" WITH REPLICATION;
ALTER USER [email protected] WITH REPLICATION;
Not sure what the solution is.
Share Improve this question asked Mar 19 at 18:25 Winston KyuWinston Kyu 1 4- 1 1) What are the error messages you get? 2) Works here on community edition Postgres. 3) This is probably a question for Google support as Cloud SQL != Postgres community edition. – Adrian Klaver Commented Mar 19 at 18:31
- @LukaszSzozda Backticks are not allowed in PostgreSQL, it's not clear why you mentioned this. The double quotes " work fine in PostgreSQL: postgresql./docs/current/… – Frank Heikens Commented Mar 19 at 19:32
- I tried the back-tick as well. that did not work. it is possible it is a GCP thing. I don't have regular postgresql setup. – Winston Kyu Commented Mar 19 at 21:39
- Please explain the problem, like "CloudSQL Postgres ALTER USER name with "-" returns error xyz. – Bouke Commented Mar 20 at 14:56
1 Answer
Reset to default 1For Cloud SQL Postgres IAM database authentication, IAM service account database users are created without the .gserviceaccount
suffix.
You can find this mentioned here in the official docs:
- For an IAM user, the username is the full email address of the user. For a service account, this is the service account's email without the
.gserviceaccount
domain suffix.
So in the case above you would use:
ALTER USER "[email protected]" WITH REPLICATION;