@@ -177,8 +177,9 @@ static unique_ptr<FunctionData> PostgresBind(ClientContext &context, TableFuncti
177177 bind_data->dsn = input.inputs [0 ].GetValue <string>();
178178 bind_data->schema_name = input.inputs [1 ].GetValue <string>();
179179 bind_data->table_name = input.inputs [2 ].GetValue <string>();
180+ bind_data->attach_path = bind_data->dsn ;
180181
181- auto con = PostgresConnection::Open (bind_data->dsn );
182+ auto con = PostgresConnection::Open (bind_data->dsn , bind_data-> attach_path );
182183 auto version = con.GetPostgresVersion ();
183184 // query the table schema so we can interpret the bits in the pages
184185 auto info = PostgresTableSet::GetTableInfo (con, bind_data->schema_name , bind_data->table_name );
@@ -317,7 +318,7 @@ static unique_ptr<GlobalTableFunctionState> PostgresInitGlobalState(ClientContex
317318 bind_data.use_transaction ? transaction.GetConnection () : transaction.GetConnectionWithoutTransaction ();
318319 result->SetConnection (con.GetConnection ());
319320 } else {
320- auto con = PostgresConnection::Open (bind_data.dsn );
321+ auto con = PostgresConnection::Open (bind_data.dsn , bind_data. attach_path );
321322 if (bind_data.use_transaction ) {
322323 PostgresScanConnect (con, string ());
323324 }
@@ -401,7 +402,7 @@ bool PostgresGlobalState::TryOpenNewConnection(ClientContext &context, PostgresL
401402 }
402403 lstate.connection = PostgresConnection (lstate.pool_connection .GetConnection ().GetConnection ());
403404 } else {
404- lstate.connection = PostgresConnection::Open (bind_data.dsn );
405+ lstate.connection = PostgresConnection::Open (bind_data.dsn , bind_data. attach_path );
405406 }
406407 PostgresScanConnect (lstate.connection , snapshot);
407408 return true ;
0 commit comments