最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

postgresql - CloudSQL Postgres ALTER USER name with "-" - Stack Overflow

programmeradmin3浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 1

For 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;
发布评论

评论列表(0)

  1. 暂无评论