Amazon RDS PostgreSQL:如何创建用户?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47249546/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Amazon RDS PostgreSQL: how to create user?
提问by Oleg
I have created 3 databases in one RDS DB instance. The owner of these databases is user postgres. I'd like to create the new power user. When I am trying to create it I receive: "User 'postgres' has no privileges to edit users" But it is the one user which I can use. How I can create the new user?
我在一个 RDS 数据库实例中创建了 3 个数据库。这些数据库的所有者是用户 postgres。我想创建新的高级用户。当我尝试创建它时,我收到:“用户‘postgres’没有编辑用户的权限”但它是我可以使用的一个用户。如何创建新用户?
回答by Neil Anderson
It looks like you need to use CREATE ROLE and assign the rds_superuser role to the new user. It's documented here http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.Roles
看起来您需要使用 CREATE ROLE 并将 rds_superuser 角色分配给新用户。它记录在这里http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.Roles
and I'll paste the instructions too:
我也会粘贴说明:
postgres=> create role testuser with password 'testuser' login;
CREATE ROLE
postgres=> grant rds_superuser to testuser;
GRANT ROLE
postgres=>