View pg_role_infos
Creates a view to get the informations about roles, it is based on pg_roles and role_inheritance.
COUTION
The view uses the function role_inheritance!
The package takes care of installing them in the right order, but when you install the view manually, you first have to install the function.
Columns
| Column Name | datatype | Description |
|---|---|---|
| rolsuper | boolean | The role has superuser privileges. |
| rolcreaterole | boolean | The role can create more roles. |
| rolcreatedb | boolean | The role can create databases. |
| rolreplication | boolean | The role is a replication role. A replication role can initiate replication connections and create and drop replication slots. |
| rolcanlogin | boolean | The role can log in. Usually group roles cannot login. |
| rolvaliduntil | timestamp with time zone | The password expiry time, NULL if no expiration. |
| rolconfig | ARRAY | The role specific defaults for run-time configuration variables, for example the search path. |
| steps | integer | The order im which the inheritance is going. |
| role_path | text | The path of the inheritance. |
| inherit_option | boolean | True if the member can SET ROLE to the granted role. |
Example
SELECT *
FROM pg_role_infos;
Result:
| oid | rolename | rolsuper | rolcreaterole | rolcreatedb | rolreplication | rolcanlogin | rolvaliduntil | rolconfig | steps | role_path | inherit_option |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 17489 | stefanie | true | false | false | false | true | {search_path=public} | 0 | stefanie | true | |
| 17489 | stefanie | true | false | false | false | true | {search_path=public} | 1 | stefanie->pg_stat_scan_tables | true |