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. |
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
---------+------+------------------+-------------+-----------------+-----------+--------------------+-------------------+-----------------+----------------
38165 | bobr | "public, premdb" | f | f | f | f | f | default | {clusteradmin}
(1 row)
Parent topic:System Views