View pg_role_permissions

Information about rights of roles on database objects.

Columns

Column Name datatype Description
schema_name name The name of the schema.
object_name name The name of the object.
object_type text The type of the object, can be one of TABLE, FUNCTION/PROCEDURE, USER DEFINED TYPE, or TABLE COLUMN.
privilege ARRAY All privileges as an array.
SELECT boolean SELECT right, NULL if not supported by the object.
INSERT boolean INSERT right, NULL if not supported by the object.
UPDATE boolean UPDATE right, NULL if not supported by the object.
DELETE boolean DELETE right, NULL if not supported by the object.
TRUNCATE boolean TRUNCATE right, NULL if not supported by the object.
REFERENCES boolean REFERENCES right, NULL if not supported by the object.
TRIGGER boolean TRIGGER right, NULL if not supported by the object.
USAGE boolean USAGE right, NULL if not supported by the object.
EXECUTE boolean EXECUTE right, NULL if not supported by the object.
GRANTABLE boolean GRANTABLE right, role can grant rights on this object.

Example

SELECT *
FROM pg_role_permissions;

Result:

role_name database_name schema_name object_name object_type privilege SELECT INSERT UPDATE DELETE TRUNCATE REFERENCES TRIGGER USAGE EXECUTE GRANTABLE
PUBLIC pgsql_tweaks_test public pg_stat_statements TABLE {SELECT} true false false false false false false     false
PUBLIC pgsql_tweaks_test public pg_stat_statements_info TABLE {SELECT} true false false false false false false     false
stefanie pgsql_tweaks_test pgsql_tweaks monitoring_active_locks TABLE {UPDATE,DELETE,TRUNCATE,REFERENCES,TRIGGER,SELECT,INSERT} true true true true true true true     true
stefanie pgsql_tweaks_test pgsql_tweaks monitoring_blocked_and_blocking_activity TABLE {DELETE,INSERT,SELECT,TRIGGER,REFERENCES,TRUNCATE,UPDATE} true true true true true true true     true