Skip to content

Commit

Permalink
Remove dispatch to stop excessive transaction bracing.
Browse files Browse the repository at this point in the history
  • Loading branch information
VersusFacit committed Feb 24, 2024
1 parent 6906eb0 commit 8051de7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dbt/include/redshift/macros/materializations/table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,14 @@
{% set existing_relation = load_cached_relation(existing_relation) %}
{% if existing_relation is not none %}
{% if existing_relation.can_be_renamed %}
{{ adapter.rename_relation(existing_relation, backup_relation) }}
{% else %}
{{ drop_relation_if_exists(existing_relation) }}
{{ adapter.rename_relation_table(existing_relation, backup_relation) }}
{% else %}
drop table if exists {{ existing_relation }} cascade;
{% endif %}
{% endif %}
{% endif %}


{{ adapter.rename_relation(intermediate_relation, target_relation) }}
alter table {{ intermediate_relation }} rename to {{ target_relation }}

{% do create_indexes(target_relation) %}

Expand Down

0 comments on commit 8051de7

Please sign in to comment.