Created
September 5, 2018 20:28
-
-
Save hazelement/f1b817ef787503128a819f912ca7c723 to your computer and use it in GitHub Desktop.
Postgres
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
/* create user with password */ | |
CREATE USER xxx WITH ENCRYPTED PASSWORD 'xxxxxxx'; | |
/* set permissions */ | |
GRANT CONNECT ON DATABASE mydb TO xxx; | |
GRANT USAGE ON SCHEMA public TO xxx; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO xxx; | |
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO xxx; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment