Postgres access check for user

I looked at the documentation for GRANT Found here , and I was trying to figure out if there is a built-in function that can let me see what level of availability I have in the databases. Of course have:

\dp and \dp mytablename

But this does not show access to my account. I would like to see ALL tables that I have access to. Can someone tell me if there is a command that can check my access level in Postgres (do I have SELECT , INSERT , DELETE , UPDATE DELETE )? And if so, what would this team be like?

+6
source share
1 answer

You can query table table_privileges in the info schema:

 SELECT table_catalog, table_schema, table_name, privilege_type FROM information_schema.table_privileges WHERE grantee = 'MY_USER' 
+14
source

Source: https://habr.com/ru/post/978157/


All Articles