Skip to content

Commit 93a8af3

Browse files
committed
Keep Postgres thread cache setting test-scoped
1 parent 6d97262 commit 93a8af3

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

src/metadata_manager/postgres_metadata_manager.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,8 @@ SELECT EXISTS (
329329
if (result->HasError()) {
330330
return false;
331331
}
332-
for (auto &row : *result) {
333-
return row.GetValue<bool>(0);
334-
}
335-
return false;
332+
auto chunk = result->Fetch();
333+
return chunk && chunk->size() > 0 && chunk->GetValue(0, 0).GetValue<bool>();
336334
}
337335

338336
// We need a specialized function here to do a reinterpret for postgres from BLOB to VARCHAR

src/storage/ducklake_initializer.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ void DuckLakeInitializer::Initialize() {
6464
error_obj.Throw("Failed to attach DuckLake MetaData \"" + catalog.MetadataDatabaseName() + "\" at path + \"" +
6565
catalog.MetadataPath() + "\"");
6666
}
67-
if (catalog.MetadataType() == "postgres" || catalog.MetadataType() == "postgres_scanner") {
68-
transaction.Query("SET pg_connection_cache=false");
69-
}
7067
// explicitly load all secrets - work-around to secret initialization bug
7168
transaction.Query("FROM duckdb_secrets()");
7269

test/configs/postgres.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "Run DuckLake tests using Postgres as a catalog DBMS.",
3-
"on_init": "ATTACH 'dbname=ducklakedb' AS pg (TYPE postgres); USE pg; DROP SCHEMA public CASCADE; DROP SCHEMA IF EXISTS metadata_s1 CASCADE; DROP SCHEMA IF EXISTS metadata_s2 CASCADE; CREATE SCHEMA public;USE memory; DETACH pg;",
3+
"on_init": "LOAD postgres_scanner; SET GLOBAL pg_pool_enable_thread_local_cache=false; ATTACH 'dbname=ducklakedb' AS pg (TYPE postgres); USE pg; DROP SCHEMA public CASCADE; DROP SCHEMA IF EXISTS metadata_s1 CASCADE; DROP SCHEMA IF EXISTS metadata_s2 CASCADE; CREATE SCHEMA public;USE memory; DETACH pg;",
44
"autoloading": "none",
55
"statically_loaded_extensions": [
66
"core_functions",

0 commit comments

Comments
 (0)