All user information is stored in a PostgreSQL system table called pg_shadow, shown
in Table 10-1. This table is only selectable by superusers, though a limited view of this table
called pg_user is accessible to normal users.
Table 10-1. The pg_shadow table
Column
|
Type
|
usename
|
name
|
usesysid
|
integer
|
usecreatedb
|
boolean
|
usetrace
|
boolean
|
usesuper
|
boolean
|
usecatupd
|
boolean
|
passwd
|
text
|
valuntil
|
abstime
|
The primary difference between the selectable data in pg_user and
pg_shadow is that the actual value of the passwd column
is not shown (it is replaced with a string of asterisks). This is a security measure to ensure that normal users are not
able to determine one another's passwords.
The usename column stores the name of the system user, which is a unique character
string (no two users may have the same name, as users are global database objects). Similarly, the
usesysid column stores a unique integer value associated with the user. The
usecreatedb and usesuper each correspond to the pair of
privileges which can be set upon creation of a user, as documented in the Section called Creating Users
."