Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon RDS PostgreSQL: how to create user?

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?

like image 646
ZedZip Avatar asked Nov 12 '17 13:11

ZedZip


1 Answers

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

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=> 
like image 180
Neil Anderson Avatar answered Nov 18 '22 03:11

Neil Anderson