Created
February 12, 2016 15:23
-
-
Save nomeyer/afae8e84972ef56f1d8b to your computer and use it in GitHub Desktop.
PostgresSQL query to show tables on which a given user has permissions of a certain type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select schemaname||'.'||tablename | |
from pg_tables | |
where has_table_privilege ( | |
'~~user_name~~', | |
schemaname||'.'||tablename, | |
'~~permission_type~~' | |
) | |
and schemaname not in ( | |
'pg_catalog', | |
'information_schema' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment