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

前端 未结 9 741
粉色の甜心
粉色の甜心 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:34

    Don't we just have to grant the admin user membership to the service role?

    create role service_role with password 'some_password';
    create database service_db with owner service_role;
    ERROR:  must be member of role "service_role"
    grant admin_user service_role;
    GRANT ROLE
    create database service_db with owner service_role;
    CREATE DATABASE
    

提交回复
热议问题