pg_user — PostgreSQL system view

The PostgreSQL pg_user system view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

The view pg_user provides access to information about database users. This is simply a publicly readable view of pg_shadow that blanks out the password field.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_user system view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • usename name
    User name
  • usesysid oid
    ID of this user
  • usecreatedb bool
    User can create databases
  • usesuper bool
    User is a superuser
  • userepl bool
    User can initiate streaming replication and put the system in and out of backup mode.
  • usebypassrls bool
    User bypasses every row-level security policy, see ddl_rowsecurity for more information.
  • passwd text
    Not the password (always reads as ********)
  • valuntil timestamptz
    Password expiry time (only used for password authentication)
  • useconfig text[]
    Session defaults for run-time configuration variables

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_user.