“ERROR: must be member of role” When creating schema in PostgreSQL

前端 未结 9 574
粉色の甜心
粉色の甜心 2021-01-31 13:01

I\'m logged in with a superuser account and this is the process I\'m doing:

1-> CREATE ROLE test WITH IN ROLE testroles PASSWORD \'testpasswd\'
2-> CREATE S         


        
9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-31 13:50

    Had this problem with RDS too.

    To solve it:

    Login as superuser

    psql --host=xxxxxxx.rds.amazonaws.com --port=5432 --username=RDS_SUPERUSER_NAME --password --dbname=postgres
    

    Create the User

    CREATE USER newuser WITH CREATEDB PASSWORD 'password';
    

    Logout

    \q
    

    Login as newuser

    psql --host=xxxxxxx.rds.amazonaws.com --port=5432 --username=newuser --password --dbname=postgres
    

    Create your DB/Schema

    CREATE SCHEMA/DATABASE ....
    

提交回复
热议问题