Created
April 11, 2017 11:39
-
-
Save mmalmeida/d8070780071d3432610cabb3747e7aae to your computer and use it in GitHub Desktop.
Postgres grant all to selected user
This file contains hidden or 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 u.groname | |
FROM pg_database d | |
JOIN pg_group u ON (d.datdba = u.grosysid) | |
WHERE d.datname = (SELECT current_database()); | |
CREATE SCHEMA IF NOT EXISTS mySchema; | |
GRANT ALL ON SCHEMA mySchema TO select_above; | |
CREATE SCHEMA IF NOT EXISTS mySchema2; | |
GRANT ALL ON SCHEMA mySchema2 TO select_above; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment