REVOKE privilege [, ...] ON object [, ...] FROM { PUBLIC | GROUP groupname | username }
view
sequence
Database = lusitania +------------------+---------------------------------------------+ | Relation | Grant/Revoke Permissions | +------------------+---------------------------------------------+ | mytable | {"=rw","miriam=arwR","group todos=rw"} | +------------------+---------------------------------------------+ Legend: uname=arwR -- 赋于一个用户的权限 group gname=arwR -- 赋于一个组(GROUP)的权限 =arwR -- 赋于公众(PUBLIC)的权限privileges granted to PUBLIC r -- SELECT w -- UPDATE/DELETE a -- INSERT R -- RULE arwR -- ALL
小技巧: 目前,要创建一个组 GROUP 你只能手工的向表 pg_group 里插入数据:(译注:这部分内容比较旧,目前已经有CREATE GROUP 语句了。)INSERT INTO pg_group VALUES ('todos'); CREATE USER miriam IN GROUP todos;
REVOKE INSERT ON films FROM PUBLIC;废除用户 manuel 对视图 kinds 的所有权限:
REVOKE ALL ON kinds FROM manuel;
REVOKE { SELECT | DELETE | USAGE | ALL PRIVILEGES } [, ...] ON object FROM { PUBLIC | username [, ...] } { RESTRICT | CASCADE } REVOKE { INSERT | UPDATE | REFERENCES } [, ...] [ ( column [, ...] ) ] ON object FROM { PUBLIC | username [, ...] } { RESTRICT | CASCADE }请参考 GRANT 命令获取独立的列/字段的细节.
REVOKE GRANT OPTION FOR privilege [, ...] ON object FROM { PUBLIC | username [, ...] } { RESTRICT | CASCADE }废除一个用户给其他用户赋予权限的权限.请参考 GRANT 命令获取独立的列/字段的细节.
[ TABLE ] 表/视图 |
CHARACTER SET 字符集 |
COLLATION 字符集 |
TRANSLATION 字符集 |
DOMAIN 域 |
如果用户1 赋予了用户2的权限带着(赋予选项) WITH GRANT OPTION ,然后用户2 给了用户3,则用户1可以使用 CASCADE 关键字废除用户2和3的权限.
如果用户1给予用户2权限带着(赋予选项)WITH GRANT OPTION,然后用户2又把它给予了用户3,则如果用户1 试图带着 RESTRICT 关键字废除这个权限就会失败.