Postgresql - User List

  • Last update: Apr 3, 2024
  • Views: 29
  • Author: Admin
Postgresql - User List

Hello colleagues.

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.

 

Request:

sql> SELECT * FROM pg_user;

users_list

 

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.

SIMILAR ARTICLES