DocsSql ReferenceInternalsCatalogsView Pg Roles

pg_roles

The view pg_roles provides access to information about database roles. This is simply a publicly readable view of pg_authid that blanks out the password field.

pg_roles Columns

Column TypeDescription
rolname nameRole name
rolsuper boolRole has superuser privileges
rolinherit boolRole automatically inherits privileges of roles it is a member of
rolcreaterole boolRole can create more roles
rolcreatedb boolRole can create databases
rolcanlogin boolRole can log in. That is, this role can be given as the initial session authorization identifier
rolreplication boolRole is a replication role. A replication role can initiate replication connections and create and drop replication slots.
rolconnlimit int4For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit.
rolpassword textNot the password (always reads as ********)
rolvaliduntil timestamptzPassword expiry time (only used for password authentication); null if no expiration
rolbypassrls boolRole bypasses every row-level security policy.
rolconfig text[]Role-specific defaults for run-time configuration variables
oid oid (references pg_authid.oid)ID of role