Created
November 15, 2017 15:14
-
-
Save evbots/8ac02b6cdd47dfba8d55d823ee8e75e2 to your computer and use it in GitHub Desktop.
SQL snippets
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
-- See all schemas and who their owners are and what access privileges are | |
SELECT n.nspname AS "Name", | |
pg_catalog.pg_get_userbyid(n.nspowner) AS "Owner", | |
pg_catalog.array_to_string(n.nspacl, E'\n') AS "Access privileges", | |
pg_catalog.obj_description(n.oid, 'pg_namespace') AS "Description" | |
FROM pg_catalog.pg_namespace n | |
WHERE n.nspname !~ '^pg_' AND n.nspname <> 'information_schema' | |
ORDER BY 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment