Postgresql - User List
- Last updated: Nov 3, 2023
- Views: 288
- Author: Admin
In today's article, we will talk about how you can see all users in a PostgreSQL database.
PostgreSQL has a system table called pg_user that stores all information about users. You can query this table which will return all the users that have been created in PostgreSQL as well as information about those users.
sql> SELECT * FROM pg_user;
Table field descriptions:
- usename - Username.
- usesysid - User ID.
- usecreatedb - Whether the user can create databases.
- usesuper - Whether the user has superuser rights.
- userrepl - Whether the user can initiate streaming replication, enable or disable backup mode.
- usebypassrls - Whether the user is subject to any row-level security policies.
- passwd - User password in the form of asterisks.
- valuntil - Password expiration date.
- useconfig - Default values for configuration variables at runtime.
Field values f means false and t means true .
Thank you all, I hope my article was of some help to you.