PostgreSQL

Скачать в pdf «PostgreSQL»


Notes


Refer to z command for further information about permissions on existing objects:


Database = lusitania


+——————+———————————————+


| Relation    |    Grant/Revoke Permissions    |


+——————+———————————————+


| mytable    |    {M=rw»,Mmiriam=arwRM,Mgroup todos=rw»}    |


+——————+———————————————+


Legend:


uname=arwR — privileges granted to a user group gname=arwR — privileges granted to a GROUP =arwR — privileges granted to PUBLIC


r — select w — update/delete


a — INSERT R — RULE arwR — ALL


Tip: Currently, to create a GROUP you have to insert data manually into table pg_group as:


INSERT INTO pg_group VALUES (‘todos’);


CREATE USER miriam IN GROUP todos;


Usage


Revoke insert privilege from all users on table films:


REVOKE INSERT ON films FROM PUBLIC;


Revoke all privileges from user manuel on view kinds:


REVOKE ALL ON kinds FROM manuel;


Compatibility


SQL92


The SQL92 syntax for REVOKE has additional capabilities for rescinding privileges, including those on individual columns in tables:


REVOKE { SELECT | DELETE | USAGE | ALL PRIVILEGES } […] ON object


FROM { PUBLIC I username [, … } { RESTRICT | CASCADE } REVOKE { INSERT | UPDATE | REFERENCES } [,…] [ (column [,…] ) ] ON object


FROM { PUBLIC | username [, …] } { RESTRICT | CASCADE } ] Refer to GRANT for details on individual fields.


REVOKE GRANT OPTION FOR privilege [, … ON object


FROM { PUBLIC | username [, …] } { RESTRICT | CASCADE } ] Rescinds authority for a user to grant the specified privilege to others. Refer to GRANT for details on individual fields.

Скачать в pdf «PostgreSQL»