Skip to content

Instantly share code, notes, and snippets.

@glassresistor
Created November 27, 2018 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glassresistor/ecfbb08b5b26c6099c7bed4cee62c888 to your computer and use it in GitHub Desktop.
Save glassresistor/ecfbb08b5b26c6099c7bed4cee62c888 to your computer and use it in GitHub Desktop.
create user django with password 'password';
create schema django authorization django;
create user rails with password 'password';
create schema rails authorization rails;
create extension hstore;
create extension pg_trgm schema rails;
grant USAGE on SCHEMA rails to django;
ALTER DEFAULT PRIVILEGES IN SCHEMA rails revoke all on tables from django;
ALTER DEFAULT PRIVILEGES IN SCHEMA rails grant select on tables to django;
ALTER DEFAULT PRIVILEGES IN SCHEMA rails revoke all on sequences from django;
ALTER DEFAULT PRIVILEGES IN SCHEMA rails grant select on sequences to django;
# ALTER DEFAULT PRIVILEGES IN SCHEMA django revoke all on tables from rails;
# ALTER DEFAULT PRIVILEGES IN SCHEMA django grant select on tables to rails;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment