How to find users in PostgreSQL
In PostgreSQL, there is a system table called pg_user. You can run a query and get the information about these Users.
SELECT * FROM pg_user;
The pg_user table contains the following columns:
| Column | Explanation |
|---|---|
| usename | User name (ie: postgres, techonthenet, etc) |
| usesysid | User ID (number assigned by PostgreSQL) |
| usecreatedb | Boolean value indicating whether user can create databases (t or f) |
| usesuper | Boolean value indicating whether user is a superuser (t or f) |
| usecatupd | Boolean value indicating whether user can update system catalogs (t or f) |
| userepl | Boolean value indicating whether user can initiate replication (t or f) |
| passwd | Password for user displayed as ******** |
| valuntil | Time when password will expire |
| useconfig | Session defaults for run-time configuration variables |
Comments