Skip to content

Fix reserved-keyword quoting in table-create DROP VIEW (#619).#677

Merged
axellpadilla merged 1 commit into
dbt-msft:masterfrom
Benjamin-Knight:fix/#619-reserved-keyword-schema-quoting
May 21, 2026
Merged

Fix reserved-keyword quoting in table-create DROP VIEW (#619).#677
axellpadilla merged 1 commit into
dbt-msft:masterfrom
Benjamin-Knight:fix/#619-reserved-keyword-schema-quoting

Conversation

@Benjamin-Knight
Copy link
Copy Markdown
Collaborator

@Benjamin-Knight Benjamin-Knight commented May 20, 2026

The inline EXEC('DROP VIEW IF EXISTS ...') in relations/table/create.sql interpolated tmp_relation.schema and tmp_relation.identifier as raw strings.
Switch to the BaseRelation renderer (include(database=False)) so the project's quoting config is respected.
Fixes #619

The inline EXEC('DROP VIEW IF EXISTS ...') in relations/table/create.sql
interpolated tmp_relation.schema and tmp_relation.identifier as raw
strings, so reserved-keyword schema names (e.g. `group`) emitted invalid
unquoted SQL and SQL Server raised "Incorrect syntax near the keyword
'group'". Switch to the BaseRelation renderer (include(database=False))
so the project's quoting config is respected.

Adds a functional regression test using `group` as the model schema with
quoting enabled and an autouse class-scope cleanup that drops the
[group].[model] table and [group] schema.
@Benjamin-Knight Benjamin-Knight added this to the v1.10.0 milestone May 21, 2026
@axellpadilla axellpadilla merged commit 24af1ca into dbt-msft:master May 21, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error on table materialization when using special schema name

2 participants