Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save v1nc3ntlaw/e1cf39e3f54741a47c1412a129f1f57c to your computer and use it in GitHub Desktop.
Save v1nc3ntlaw/e1cf39e3f54741a47c1412a129f1f57c to your computer and use it in GitHub Desktop.

Revisions

  1. @mr-linch mr-linch revised this gist Feb 6, 2021. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion create-read-only-user.sql
    Original file line number Diff line number Diff line change
    @@ -12,4 +12,7 @@ grant select on all tables in schema public to metabase;

    -- allow user to access all tables in schema
    alter default privileges in schema public
    grant select on tables to metabase;
    grant select on tables to metabase;

    -- limit number of connections
    -- alter role metabase with connection limit 10
  2. @mr-linch mr-linch revised this gist Feb 6, 2021. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions create-read-only-user.sql
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,9 @@ grant connect on database site to metabase;
    -- allow user access to schema
    grant usage on schema public to metabase;

    -- grant select on existing tables
    grant select on all tables in schema public to metabase;

    -- allow user to access all tables in schema
    alter default privileges in schema public
    grant select on tables to metabase;
  3. @mr-linch mr-linch revised this gist Feb 6, 2021. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions create-read-only-user.sql
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    # create user (e.g. metabase)
    -- create user (e.g. metabase)
    create user metabase with encrypted password 'password';

    # allow user connect to db
    -- allow user connect to db
    grant connect on database site to metabase;

    # allow user access to schema
    -- allow user access to schema
    grant usage on schema public to metabase;

    # allow user to access all tables in schema
    -- allow user to access all tables in schema
    alter default privileges in schema public
    grant select on tables to metabase;
  4. @mr-linch mr-linch created this gist Feb 6, 2021.
    12 changes: 12 additions & 0 deletions create-read-only-user.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    # create user (e.g. metabase)
    create user metabase with encrypted password 'password';

    # allow user connect to db
    grant connect on database site to metabase;

    # allow user access to schema
    grant usage on schema public to metabase;

    # allow user to access all tables in schema
    alter default privileges in schema public
    grant select on tables to metabase;