pgsql-基础命令

阅读量: zyh 2021-12-29 15:37:00
Categories: > Tags:

授权命令

# 授权只读
grant select on all tables in schema <schema_name> to <username>;
grant usage on schema <schema_name> to <username>;
alter default privileges in schema <schema_name> grant select on tables to <username>;

# 授权读写
grant all on all tables in schema <schema_name> to <username>;
grant all on schema <schema_name> to <username>;
alter default privileges in schema <schema_name> grant all on tables to <username>;

🤷‍♂️默认授权规则,必须是schema所有者修改才会生效。