PostgreSQL – List Users

Background

Let us list principals and roles for our PostgreSQL Instance.

Code

Schema :- pg_catalog

Table :- pg_authid

SQL


select 

		  tblPCA.rolname as "role"

		, tblPCA.rolsuper as "superUser"  

		, tblPCA.rolcreaterole as "createRole"

		, tblPCA.rolcreatedb as "createDB"

		, tblPCA.rolcanlogin as "canLogin"		

		, tblPCA.rolconnlimit as "connectionLimit"	

		, tblPCA.rolpassword  as "passwordHash"

		, tblPCA.rolvaliduntil as "validUntil"

from  pg_catalog.pg_authid tblPCA

Output

pg_catalog.pg_authid.20190729.0202PM

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s