Last active
June 14, 2020 20:50
-
-
Save hiddentao/10120aa606a574aa3c0c85fa0548078a to your computer and use it in GitHub Desktop.
Create read-only user for specific Postgres db
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 user_name with encrypted password '...'; | |
grant connect on database "db-name" TO user_name; | |
grant usage on schema public to user_name; | |
grant select on all tables in schema public to user_name; | |
alter default privileges in schema public grant select on tables to user_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment