Planet PostgreSQL

Planet PostgreSQL -

Henrietta Dombrovskaya: I have a question…

Below is an excerpt from PostgreSQL documentation. Please, do not take me wrong – I take permissions and security very seriously, probably more than many others. I believe I have a very decent understanding of how PostgreSQL permissions work, better than many others. Still, my favorite database never fails to surprise me! If a superuser chooses to issue a GRANT or REVOKE command, the command is performed as though it were issued by the owner of the affected object. Since all privileges ultimately come from the object owner (possibly indirectly via chains of grant options), it is possible for a superuser to revoke all privileges, but this might require use of CASCADE as stated above. REVOKE can also be done by a role that is not the owner of the affected object, but is a member of the role that owns the object, or is a member of a role that holds privileges WITH GRANT OPTION on the object. In this case the command is performed as though it were issued by the containing role that actually owns the object or holds the privileges WITH GRANT OPTION. For example, if table t1 is owned by role g1, of which role u1 is a member, then u1 can revoke privileges on t1 that are recorded as being granted by g1. This would include grants made by u1 as well as by other members of role g1. Please read these two paragraphs, preferably read them out loud. I have two questions. First, why in the world it has to be so complicated?! And second – why PostgreSQL documentation has to be written like that?!

超级用户可以使用GRANT或REVOKE命令,这些命令会以对象拥有者的身份执行。虽然超级用户可以撤销所有权限,但可能需要使用CASCADE。非对象拥有者也可以使用REVOKE,但也要以拥有对象或拥有WITH GRANT OPTION权限的角色的身份执行。这种复杂的权限管理系统令人费解,PostgreSQL文档也写得很晦涩难懂。

相关推荐 去reddit讨论

热榜 Top10

观测云
观测云
LigaAI
LigaAI
eolink
eolink
Dify.AI
Dify.AI

推荐或自荐