↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / System Catalogs

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.

English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.

Reading PG 18·Select a recorded version

kind
view
lang
en
measured attributes
true
metadata release
18.6
runtime columns
rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, rolcanlogin, rolreplication, rolconnlimit, rolpassword, rolvaliduntil, rolbypassrls, rolconfig, oid
runtime verified
false
source
english-manual

Definition PG 18

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.

Catalog columns

ColumnTypeNullabilityDescription
rolnamenameNullableRole name
rolsuperboolNullableRole has superuser privileges
rolinheritboolNullableRole automatically inherits privileges of roles it is a member of
rolcreateroleboolNullableRole can create more roles
rolcreatedbboolNullableRole can create databases
rolcanloginboolNullableRole can log in. That is, this role can be given as the initial session authorization identifier
rolreplicationboolNullableRole is a replication role. A replication role can initiate replication connections and create and drop replication slots.
rolconnlimitint4NullableFor roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit.
rolpasswordtextNullableNot the password (always reads as ********)
rolvaliduntiltimestamptzNullablePassword expiry time (only used for password authentication); null if no expiration
rolbypassrlsboolNullableRole bypasses every row-level security policy, see Section 5.9 for more information.
rolconfigtext[]NullableRole-specific defaults for run-time configuration variables
oidoidNullableID of role

Compare versions

Source references

Full definition and evidence JSON

Definition sources

center · PostgreSQL 18 · catalog-bilingual-repair:30912e8165d949b9420f58d1a17e70cb6e6bd9fdf63106e63af168e99d856730

Text language: en · catalog-bilingual-repair:30912e8165d949b9420f58d1a17e70cb6e6bd9fdf63106e63af168e99d856730