该主题已有多个主题。但是我无法完成它,并不断出现“权限被拒绝”错误。我一定做错了什么。
我的目标:在我想要的postgres数据库“ mydatabase”上
我如何尝试(大致):
psql -h /var/run/postgresql -p5433 -U postgres
create role group_x;
create role user_a LOGIN INHERIT PASSWORD <password>;
create role user_b LOGIN INHERIT PASSWORD <password>;
grant group_x to user_a;
grant group_x to user_b;
\connect mydatabase;
grant all on schema schema_x to group_x;
grant all on all tables in schema schema_x to group_x;
grant all on all sequences in schema schema_x to group_x;
grant all on all functions in schema schema_x to group_x;
set role group_x;
alter default privileges for role group_x in schema schema_x
grant all on tables to group_x;
alter default privileges for role group_x in schema schema_x
grant all on sequences to group_x;
alter default privileges for role group_x in schema schema_x
grant all on functions to group_x;
感谢您指出我的错误!
答案 0 :(得分:0)
如果您MyList <- list(data1,data2,data3...,data12)
,则意味着特权仅授予由用户ALTER DEFAULT PRIVILEGES FOR ROLE group_x
创建的将来对象 。
因此,您需要在group_x
子句中指定创建表的用户。