DBA Hub

📋Steps in this guide1/1

List roles present in postgres

List roles :

postgresql configurationintermediate
by PostgreSQL
12 views
1

List roles present in postgres

List roles : rolcanlogin - > If true mean they are role as well as user If false mean they are only role( they cannot login)

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
postgres=#
select rolname,rolcanlogin,rolvaliduntil from pg_roles;
rolname               | rolcanlogin | rolvaliduntil
----------------------+-------------+---------------------------
pg_monitor            | f           |
pg_read_all_settings  | f           |
pg_read_all_stats     | f           |
pg_stat_scan_tables   | f           |
pg_signal_backend     | f           |
postgres              | t           |
test_dbuser1          | f           | 2020-08-08 00:00:00+05:30
NOTE
- > In postgres users are bydefault role, but roles are not bydefault user. i.e
Bydefault user come with login privilege, where as roles don’t come with login privilege.

Comments (0)

Please to add comments

No comments yet. Be the first to comment!