pg_has_role()

A system function determining whether a user is a member of a particular role

pg_has_role() is a system function determining whether a database user is a member of a particular role (group).

pg_has_role() was added in PostgreSQL 8.1 (commit f9fd1764).

Examples

postgres=# SELECT pg_has_role('pg_read_all_settings', 'MEMBER');
 pg_has_role 
-------------
 t
(1 row)

Categories

System function, User management

See also

pg_auth_members