Skip to content

Instantly share code, notes, and snippets.

@glassresistor
Created November 27, 2018 23:52
Show Gist options
  • Select an option

  • Save glassresistor/ecfbb08b5b26c6099c7bed4cee62c888 to your computer and use it in GitHub Desktop.

Select an option

Save glassresistor/ecfbb08b5b26c6099c7bed4cee62c888 to your computer and use it in GitHub Desktop.

Revisions

  1. glassresistor created this gist Nov 27, 2018.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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;