diff --git a/.changes/unreleased/Fixes-20230918-145127.yaml b/.changes/unreleased/Fixes-20230918-145127.yaml new file mode 100644 index 00000000000..e30235d9597 --- /dev/null +++ b/.changes/unreleased/Fixes-20230918-145127.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Add column quotes in macro to avoid build failure +time: 2023-09-18T14:51:27.988997-06:00 +custom: + Author: seanglynn-thrive + Issue: "8667" diff --git a/core/dbt/include/global_project/macros/adapters/columns.sql b/core/dbt/include/global_project/macros/adapters/columns.sql index b5a03ec53b5..ebbe7db4e67 100644 --- a/core/dbt/include/global_project/macros/adapters/columns.sql +++ b/core/dbt/include/global_project/macros/adapters/columns.sql @@ -118,11 +118,11 @@ alter {{ relation.type }} {{ relation }} {% for column in add_columns %} - add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }} + add column {{ adapter.quote(column.name) }} {{ column.data_type }}{{ ',' if not loop.last }} {% endfor %}{{ ',' if add_columns and remove_columns }} {% for column in remove_columns %} - drop column {{ column.name }}{{ ',' if not loop.last }} + drop column {{ adapter.quote(column.name) }}{{ ',' if not loop.last }} {% endfor %} {%- endset -%}