pg_user

A system catalogue view providing a publicly-accessible version of pg_shadow

pg_user is a system catalogue view providing a publicly-accessible version of pg_shadow, with identical fields apart from passwd, which is displayed as a series of asterisks (regardless of whether or not a password is set for the user).

pg_user was added in in PostgreSQL 6.3 (commit 780068f8), replacing the former system catalogue table pg_user, which was replaced by pg_shadow.

Definition by PostgreSQL version

pg_user (PostgreSQL 13)

                        View "pg_catalog.pg_user"
    Column    |           Type           | Collation | Nullable | Default
--------------+--------------------------+-----------+----------+---------
 usename      | name                     |           |          |
 usesysid     | oid                      |           |          |
 usecreatedb  | boolean                  |           |          |
 usesuper     | boolean                  |           |          |
 userepl      | boolean                  |           |          |
 usebypassrls | boolean                  |           |          |
 passwd       | text                     |           |          |
 valuntil     | timestamp with time zone |           |          |
 useconfig    | text[]                   | C         |          |
    

Documentation: pg_user

pg_user (PostgreSQL 12)

                        View "pg_catalog.pg_user"
    Column    |           Type           | Collation | Nullable | Default
--------------+--------------------------+-----------+----------+---------
 usename      | name                     |           |          |
 usesysid     | oid                      |           |          |
 usecreatedb  | boolean                  |           |          |
 usesuper     | boolean                  |           |          |
 userepl      | boolean                  |           |          |
 usebypassrls | boolean                  |           |          |
 passwd       | text                     |           |          |
 valuntil     | timestamp with time zone |           |          |
 useconfig    | text[]                   | C         |          |
    

Documentation: pg_user

pg_user (PostgreSQL 11)

                View "pg_catalog.pg_user"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 usename      | name    |           |          |
 usesysid     | oid     |           |          |
 usecreatedb  | boolean |           |          |
 usesuper     | boolean |           |          |
 userepl      | boolean |           |          |
 usebypassrls | boolean |           |          |
 passwd       | text    |           |          |
 valuntil     | abstime |           |          |
 useconfig    | text[]  |           |          |
    

Documentation: pg_user

pg_user (PostgreSQL 10)

                View "pg_catalog.pg_user"
    Column    |  Type   | Collation | Nullable | Default
--------------+---------+-----------+----------+---------
 usename      | name    |           |          |
 usesysid     | oid     |           |          |
 usecreatedb  | boolean |           |          |
 usesuper     | boolean |           |          |
 userepl      | boolean |           |          |
 usebypassrls | boolean |           |          |
 passwd       | text    |           |          |
 valuntil     | abstime |           |          |
 useconfig    | text[]  |           |          |
    

Documentation: pg_user

pg_user (PostgreSQL 9.6)

     View "pg_catalog.pg_user"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 usename      | name    |
 usesysid     | oid     |
 usecreatedb  | boolean |
 usesuper     | boolean |
 userepl      | boolean |
 usebypassrls | boolean |
 passwd       | text    |
 valuntil     | abstime |
 useconfig    | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.5)

     View "pg_catalog.pg_user"
    Column    |  Type   | Modifiers
--------------+---------+-----------
 usename      | name    |
 usesysid     | oid     |
 usecreatedb  | boolean |
 usesuper     | boolean |
 userepl      | boolean |
 usebypassrls | boolean |
 passwd       | text    |
 valuntil     | abstime |
 useconfig    | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.4)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 userepl     | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.3)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 userepl     | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.2)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 userepl     | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.1)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 userepl     | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 9.0)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
    

Documentation: pg_user

pg_user (PostgreSQL 8.4)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
View definition:
 SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig
   FROM pg_shadow;
    

Documentation: pg_user

pg_user (PostgreSQL 8.3)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
View definition:
 SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig
   FROM pg_shadow;
    

Documentation: pg_user

pg_user (PostgreSQL 8.2)

     View "pg_catalog.pg_user"
   Column    |  Type   | Modifiers
-------------+---------+-----------
 usename     | name    |
 usesysid    | oid     |
 usecreatedb | boolean |
 usesuper    | boolean |
 usecatupd   | boolean |
 passwd      | text    |
 valuntil    | abstime |
 useconfig   | text[]  |
View definition:
 SELECT pg_shadow.usename, pg_shadow.usesysid, pg_shadow.usecreatedb, pg_shadow.usesuper, pg_shadow.usecatupd, '********'::text AS passwd, pg_shadow.valuntil, pg_shadow.useconfig
   FROM pg_shadow;
    

Documentation: pg_user

Change history

Examples

postgres=> SELECT * FROM pg_user WHERE usename='postgres'\x\g\x
Expanded display is on.
-[ RECORD 1 ]+---------------------------
usename      | postgres
pg_authid|usesysid\\     | 10
usecreatedb  | t
usesuper     | t
userepl      | t
usebypassrls | t
passwd       | ********
valuntil     | 
useconfig    | {password_encryption=true}
  • PostgreSQL documentation: pg_user

Categories

System catalogue

See also

pg_authid, pg_shadow