Skip to content

[Bug] GRANT revoke statements in redshift fails when usernames contain certain characters (eg. .) #172

@ivansabik

Description

@ivansabik

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When grants are setup in an incremental model dbt attempts to run some a REVOKE statement. When the username(s) that currently have access to that table contain a dot character (eg. ivan.sabik), which is completely valid for a Redshift username , building those models fails with:

syntax error at or near "."

That would be solved by adding quotes to those users, that is instead of revoke select on table eventview from ivan.sabik it should be revoke select on table eventview from "ivan.sabik"

Expected Behavior

REVOKE statements don't throw a syntax error

Steps To Reproduce

  1. Create a username containing a dot character
  2. Run an incremental dbt model
  3. Manually add GRANT statements for the user from step 1
  4. Add a grant configuration in dbt for this model
  5. Re-run the model
  6. Confirm you get an error: syntax error at or near "."

Relevant log output

No response

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

redshift

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:grantsIssues related to dbt's grants functionalityfeature:quotingIssues related to dbt's quoting behaviortype:enhancementNew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions