From 11ed3a0d3ba1791cfb3c269581feadb4e9947deb Mon Sep 17 00:00:00 2001 From: HaoNan Ye <81568420+yehaonanxx@users.noreply.github.com> Date: Fri, 26 Jun 2026 17:58:07 +0800 Subject: [PATCH] fix(postgres): include public schema in search_path for PostGIS functions (#1817) --- crates/dbx-core/src/db/postgres.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/dbx-core/src/db/postgres.rs b/crates/dbx-core/src/db/postgres.rs index 96f5eda80..47df3e1a7 100644 --- a/crates/dbx-core/src/db/postgres.rs +++ b/crates/dbx-core/src/db/postgres.rs @@ -1850,7 +1850,10 @@ pub async fn execute_query_with_schema_and_max_rows( } let set_schema_start = Instant::now(); - client.execute(&format!("SET search_path TO {}", pg_quote_ident(schema)), &[]).await.map_err(pg_error_to_string)?; + client + .execute(&format!("SET search_path TO {}, public", pg_quote_ident(schema)), &[]) + .await + .map_err(pg_error_to_string)?; log::info!( "[postgres][execute_with_schema:set-search-path:done] elapsed_ms={} total_ms={}", set_schema_start.elapsed().as_millis(), @@ -1914,7 +1917,10 @@ pub async fn execute_query_with_schema_and_max_rows_and_cancel( } let set_schema_start = Instant::now(); - client.execute(&format!("SET search_path TO {}", pg_quote_ident(schema)), &[]).await.map_err(pg_error_to_string)?; + client + .execute(&format!("SET search_path TO {}, public", pg_quote_ident(schema)), &[]) + .await + .map_err(pg_error_to_string)?; log::info!( "[postgres][execute_with_schema:set-search-path:done] elapsed_ms={} total_ms={}", set_schema_start.elapsed().as_millis(),