Give all the permissions to a user on a DB

后端 未结 5 794
梦如初夏
梦如初夏 2020-12-07 06:59

I would like to give an user all the permissions on a database without making it an admin. The reason why I want to do that is that at the moment DEV and PROD are different

5条回答
  •  失恋的感觉
    2020-12-07 07:38

    I did the following to add a role 'eSumit' on PostgreSQL 9.4.15 database and provide all permission to this role :

    CREATE ROLE eSumit;
    
    GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO eSumit;
    
    GRANT ALL PRIVILEGES ON DATABASE "postgres" to eSumit;
    
    ALTER USER eSumit WITH SUPERUSER;
    

    Also checked the pg_table enteries via :

    select * from pg_roles;

    Database queries snapshot :

提交回复
热议问题