1

I was trying to find out the user/roles which got elevated privileges in the postgres database.
Elevated privileges like alter/drop/create/owner of table i.e. any user who can change the existing tables or can create/drop the table..
I was going through the different views under information_schema an pg_catalog but did not find out the correct table, most of the views showcase Read-write privileges only like select/insert/update/delete.
So, could anyone help here to find out the correct table or redirect to the query which could provide the desired results. Thanks.

Sandy
  • 419
  • 1
  • 8
  • 15

1 Answers1

0

DROP/ALTER - The right to drop an object, or to alter its definition in any way, is not treated as a grantable privilege; it is inherent in the owner, and cannot be granted or revoked here .
CREATE privilege is only on SCHEMA and not table. Below query from this question gives the schemas where a user has create privilege

SELECT 
    n.nspname AS schema_name
   FROM pg_namespace n
  WHERE  has_schema_privilege('user',n.nspname, 'CREATE');