PostgreSQL - 权限管理

DB 级别

GRANT CONNECT ON DATABASE database TO user;
GRANT CREATE ON DATABASE database TO user;

Schema 级别

GRANT USAGE ON SCHEMA schema TO user;
GRANT CREATE ON SCHEMA schema TO user;

Table 级别

GRANT SELECT ON TABLE table TO user;
GRANT UPDATE ON TABLE table TO user;
GRANT DELETE ON TABLE table TO user;
GRANT INSERT ON TABLE table TO user;
GRANT TRUNCATE ON TABLE table TO user;
GRANT TRIGGER ON TABLE table TO user;
GRANT REFERENCES ON TABLE table TO user;

Column 级别

GRANT SELECT(column) ON TABLE table TO user;
GRANT INSERT(column) ON TABLE table TO user;
GRANT UPDATE(column) ON TABLE table TO user;
GRANT REFERENCES(column) ON TABLE table TO user;
    原文作者:青鱼之鱼
    原文地址: https://www.jianshu.com/p/93b936a17a34
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞