Appearance
sys.user
A system view that returns information about the users in the system. See also sys.role.
Superusers can see all users in this view. Users and roles with CREATE ROLE
, ALTER ANY ROLE
, or DROP ANY ROLE
privilege can also see all users in this view.
Users and roles that are not superusers and do not have (or inherit) CREATE ROLE
, ALTER ANY ROLE
, or DROP ANY ROLE
privilege can only see their own accounts in this view.
Column Name | Data Type | Description |
---|---|---|
user_id | bigint | The unique ID for the user or role. |
name | text | Name of the user or role. |
search_path | text | Value of the search_path parameter for the user (a comma-delimited list of schemas). |
create_role | boolean | Whether the user can create other users. |
create_database | boolean | Whether the user can create databases. |
superuser | boolean | Whether the user has superuser privileges. |
has_local_password | boolean | true means that the user has a local password set via ALTER USER (or CREATE USER ). false means that the user does not have a local password and may depend on an LDAP password for login. |
ldap_synchronized | boolean | true means that this user exists in the database via LDAP synchronization. |
default_cluster | text | Default virtual compute cluster that was set for the role, if any. |
memberof | name[] | Roles that the user is a member of. |
connection_limit | smallint | Max number of connections the user can have. This is reserved for future use. |
is_inherit | boolean | Is this user or role inherting permission? This is reserved for future use. |
is_password_encrypted | boolean | |
last_login | timestampz | When the user was last logged in? |
last_password_change | timestampz | When did the user last changed their password? |
creation_time | timestampz | When the user was created. |
login_attempts | integer | Current number of failed login attempts. |
Example
yellowbrick_test=> select * from sys.user where name='bobr';
user_id | name | search_path | create_role | create_database | superuser | has_local_password | ldap_synchronized | default_cluster | memberof | connection_limit | is_inherit | is_password_encrypted | last_login | last_password_change | creation_time | login attempts |
---------+------+------------------+-------------+-----------------+-----------+--------------------+-------------------+-----------------+----------------
38165 | bobr | "public, premdb" | f | f | f | f | f | default | {clusteradmin} | | | | 2024-07-19T13:22:23.484905Z | | 2024-07-19T13:10:49.036817Z | 0 |
(1 row)