Created
December 19, 2013 09:22
-
-
Save chanmix51/8036615 to your computer and use it in GitHub Desktop.
read only user in postgresql
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
CREATE USER backup_user WITH ENCRYPTED PASSWORD 'password'; | |
GRANT CONNECT ON DATABASE production to backup_user; | |
\c production | |
GRANT USAGE ON SCHEMA public to backup_user; /*thanks Dominic!*/ | |
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup_user; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup_user; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment