Last active
July 17, 2018 13:24
-
-
Save coder4web/c5c041685e32c322eb007197b28f5ae6 to your computer and use it in GitHub Desktop.
PostgreSQL roles
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
-- Full access | |
GRANT ALL privileges ON DATABASE db TO admin_user; | |
GRANT ALL ON schema public TO admin_user; | |
GRANT ALL ON ALL TABLES IN SCHEMA public TO admin_user; | |
GRANT USAGE, SELECT ON ALL SEQUENCES IN SCHEMA public TO admin_user; | |
-- Read-only access | |
GRANT USAGE ON SCHEMA public TO read_user; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_user; | |
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO read_user; | |
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO read_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment