Skip to content

Commit

Permalink
Fix MotherDuck table sync (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF authored Nov 13, 2024
1 parent 9928538 commit 7e21cbe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pgduckdb_background_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,14 @@ SyncMotherDuckCatalogsWithPg_Cpp(bool drop_with_cascade) {

initial_cache_version = pgduckdb::CacheVersion();

auto connection = pgduckdb::DuckDBManager::GetConnection();
/*
* We don't use GetConnection, because we want to be able to precisely
* control the transaction lifecycle. We commit Postgres connections
* throughout this function, and the GetConnect its cached connection its
* lifecycle would be linked to those postgres transactions, which we
* don't want.
*/
auto connection = pgduckdb::DuckDBManager::Get().CreateConnection();
auto &context = *connection->context;

auto &db_manager = duckdb::DatabaseManager::Get(context);
Expand Down

0 comments on commit 7e21cbe

Please sign in to comment.