Sunday 20 December 2020

how to check the privileges assigned to a role in postgresql

 SELECT table_catalog, table_schema, table_name, privilege_type FROM information_schema.table_privileges 

WHERE grantee = 'MY_USER'


SELECT grantee,table_catalog, table_schema, table_name, privilege_type
FROM   information_schema.table_privileges 
WHERE  grantee not in ('pg_monitor','PUBLIC');
select list of roles in postgresql:
SELECT rolname FROM pg_roles;

locate HBA files
+++++++++++++++
SELECT name, setting
FROM pg_settings WHERE name LIKE '%hba%';
*****************************************************
To check user having password:

select usename,passwd from pg_shadow where passwd IS NOT NULL

*********************************************************


Featured post

Postgres commads

 [oracle@Tesdb ~]$ systemctl status postgresql-15 ● postgresql-15.service - PostgreSQL 15 database server    Loaded: loaded (/usr/lib/system...