Summary
The view pg_shadow exists for backwards compatibility: it emulates a catalog that existed in PostgreSQL before version 8.1. It shows properties of all roles that are marked as rolcanlogin in pg_authid.
(Description quoted from the official PostgreSQL documentation.)
Columns
The pg_shadow system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):
usenamenamereferencespg_authid.rolname
User nameusesysidoidreferencespg_authid.oid
ID of this userusecreatedbbool
User can create databasesusesuperbool
User is a superuserusereplbool
User can initiate streaming replication and put the system in and out of backup mode.usebypassrlsbool
User bypasses every row-level security policy, see ddl_rowsecurity for more information.passwdtext
Encrypted password; null if none. See pg_authid for details of how encrypted passwords are stored.valuntiltimestamptz
Password expiry time (only used for password authentication)useconfigtext[]
Session defaults for run-time configuration variables
Related catalogs
This object references the following other system catalogs:
usename→pg_authid
Version applicability
Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.
Related & references
Reference: PostgreSQL documentation — pg_shadow.