Skip to content

Instantly share code, notes, and snippets.

@hiddentao
Last active June 14, 2020 20:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Create read-only user for specific Postgres db
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