PostgreSQL · Command
GRANT
GRANT gives roles privileges on database objects or makes one role a member of another. It can also control whether a member may pass on membership, inherit privileges, or switch to the granted role.
Last updated
Syntax
GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER | MAINTAIN } [, ...] | ALL [ PRIVILEGES ] } ON { [ TABLE ] table_name [, ...] | ALL TABLES IN SCHEMA schema_name [, ...] } TO role_specification [, ...] [ WITH GRANT OPTION ] [ GRANTED BY role_specification ]
GRANT role_name [, ...] TO role_specification [, ...] [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] [ GRANTED BY role_specification ]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
REVOKESET ROLEALTER ROLECREATE ROLE