参考链接
https://www.postgresql.org/docs/current/sql-altertable.html
https://blog.csdn.net/qq_34484062/article/details/132984479
语句
用户B有用A的对象的访问权限
grant a to b;
如果只限定增删改查,首要对schema有权限
grant usage on schemaX to b;
PostgreSQL权限
\dp显示的权限
所有表
user1 -> user2
GRANT SELECT,update,delete,insert ON ALL TABLES IN SCHEMA public TO user_name;
user2 -> user1
指定表
grant select,update,delete,insert on schemaX.xx to b;
对以后创建的表有权限
alter default privileges in schema schemaX grant select,update,delete,insert on tables to b;
最终效果: