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

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


No comments:

Post a Comment

Featured post

duplicate db from standy to other server

 Duplicate Testuat   $ export ORACLE_SID=Testuat3 $ sqlplus '/as sysdba' Testuat3 SQL> alter system set cluster_database=FALSE sc...