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: Add schema in Postgres Cache to swapping method #149

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions airbyte/_processors/sql/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,11 @@ def _swap_temp_table_with_final_table(
deletion_name = f"{final_table_name}_deleteme"
commands = "\n".join(
[
f"ALTER TABLE {final_table_name} RENAME TO {deletion_name};",
f"ALTER TABLE {temp_table_name} RENAME TO {final_table_name};",
f"DROP TABLE {deletion_name};",
f"ALTER TABLE {self._fully_qualified(final_table_name)} RENAME"
f"TO {deletion_name};",
f"ALTER TABLE {self._fully_qualified(temp_table_name)} RENAME"
f"TO {final_table_name};",
f"DROP TABLE {self._fully_qualified(deletion_name)};",
aaronsteers marked this conversation as resolved.
Show resolved Hide resolved
]
)
self._execute_sql(commands)
Expand Down
Loading