Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a mechanism for granting usage to schemas in on-run-end #908

Closed
drewbanin opened this issue Aug 8, 2018 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request redshift
Milestone

Comments

@drewbanin
Copy link
Contributor

Feature

Feature description

If a user makes use of custom schemas, then on-run-end cannot currently be used to grant usage to the schemas on Redshift/Snowflake/Postgres. This problem arises because there are N schemas, but the only schema available in the context is the schema defined in the target.

dbt should provide in it's context a list of schemas that were built into during the dbt run.

Example usage:

on-run-end:  {% for schema in schemas %}grant usage on {{ schema }} to PUBLIC;{% endfor %}

We probably will want to namespace schemas, but this is the general idea.

Who will this benefit?

This will be useful specifically for Redshift users. Currently, granting usage to a schema must happen in post-hooks, and Redshift appears to raise concurrent transaction errors if usage is granted to a schema while other models are being created/dropped in that schema (ie. with threads > 1)

@drewbanin drewbanin added enhancement New feature or request redshift labels Aug 8, 2018
@beckjake beckjake self-assigned this Sep 26, 2018
beckjake added a commit that referenced this issue Oct 15, 2018
…n-run-end

make schemas available to on-run-end hooks (#908)
@beckjake
Copy link
Contributor

Fixed in #1028

@drewbanin drewbanin added this to the Guion Bluford milestone Oct 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request redshift
Projects
None yet
Development

No branches or pull requests

3 participants