You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dbt replaces a view or table in an incremental build, it creates a backup_relation. This relation is intended to be dropped at the end of model build. Errantly, dbt created this backup_relation without a schema on postgres and redshift. This results in a (correct) rename query which looks like:
alter table schema.table rename to table__dbt_backup_20191118
but the corresponding drop at the end of the builds looks like:
drop table if exists table__dbt_backup_20191118
This second query is incorrect, as it this query is looking for a table called table__dbt_backup_20191118 in the public schema! As a result, full refresh builds on postgres + redshift may have been leaving backup tables in dbt schemas since at least 0.14.3, though possibly earlier.
Steps To Reproduce
Using 0.14.x, create an incremental model and run it with the --full-refresh flag a couple of times. You should see lingering backup tables in the dbt schema.
System information
Which database are you using dbt with?
postgres
redshift
The text was updated successfully, but these errors were encountered:
Describe the bug
When dbt replaces a view or table in an incremental build, it creates a
backup_relation
. This relation is intended to be dropped at the end of model build. Errantly, dbt created thisbackup_relation
without a schema on postgres and redshift. This results in a (correct) rename query which looks like:but the corresponding drop at the end of the builds looks like:
This second query is incorrect, as it this query is looking for a table called
table__dbt_backup_20191118
in thepublic
schema! As a result, full refresh builds on postgres + redshift may have been leaving backup tables in dbt schemas since at least 0.14.3, though possibly earlier.Steps To Reproduce
Using 0.14.x, create an incremental model and run it with the
--full-refresh
flag a couple of times. You should see lingering backup tables in the dbt schema.System information
Which database are you using dbt with?
The text was updated successfully, but these errors were encountered: