Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for drop statement which was not namespaced to a schema #1931

Merged

Conversation

drewbanin
Copy link
Contributor

@drewbanin drewbanin commented Nov 18, 2019

The backup_relation was previously created without a schema. This results in a (correct) rename query which looked like:

alter table schema.table rename to table__dbt_backup_20191118

The corresponding drop however also looked like:

drop table if exists table__dbt_backup_20191118

This was 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.

@cla-bot cla-bot bot added the cla:yes label Nov 18, 2019
@drewbanin drewbanin marked this pull request as ready for review November 18, 2019 20:36
Copy link
Contributor

@beckjake beckjake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@drewbanin drewbanin merged commit 09f2aae into dev/louisa-may-alcott Nov 19, 2019
@drewbanin drewbanin deleted the fix/drop-backup-tables-on-full-refresh branch November 19, 2019 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants