Skip to content

Instantly share code, notes, and snippets.

@aks
Created April 24, 2018 21:57
Show Gist options
  • Select an option

  • Save aks/ad2b883511ab18a7abb4d6f9fc6fe2f9 to your computer and use it in GitHub Desktop.

Select an option

Save aks/ad2b883511ab18a7abb4d6f9fc6fe2f9 to your computer and use it in GitHub Desktop.
Create read-only SQL user
-- create a read-only user
create role procore_ro;
-- allow the RO user to use the public schema
grant usage on schema public to procore_ro;
-- grant RO access on existing tables
grant select on all tables in schema public to procore_ro;
-- grant RO access on future tables
alter default privileges in schema public grant select on tables to procore_ro;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment