Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active January 3, 2023 21:20
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 garystafford/8ac39d2b8b9e273914946ed5b62dc93c to your computer and use it in GitHub Desktop.
Save garystafford/8ac39d2b8b9e273914946ed5b62dc93c to your computer and use it in GitHub Desktop.
-- create dbt user and group
create user dbt with password 'CHANGE_ME!'
nocreatedb nocreateuser syslog access restricted
connection limit 10;
-- create dbt group
create group dbt with user dbt;
-- grants on tickit_external schema
grant usage on schema tickit_external to group dbt;
grant create on schema tickit_external to group dbt;
grant all on all tables in schema tickit_external to group dbt;
-- grants on tickit_dbt schema
grant usage on schema tickit_dbt to group dbt;
grant create on schema tickit_dbt to group dbt;
grant all on all tables in schema tickit_dbt to group dbt;
-- reassign schema ownership to dbt
alter schema tickit_dbt owner to dbt;
alter schema tickit_external owner to dbt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment