Skip to content

Do not wrap postgres_query SQL unless necessary - #620

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:query_wrap
Oct 15, 2026
Merged

staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:query_wrap

Conversation

@staticlibs

Copy link
Copy Markdown
Member

The query passed to postgres_query() function was being wrapped into a subquery with an explicit list of columns. This wrapping is necessary in some cases when a Postgres-side CAST is required for particular column. But it can be omitted in most of the usual cases.

This PR enables the wrapping of the user query only when necessry.

Ref: duckdblabs/duckdb-internal#11178

The query passed to `postgres_query()` function was being wrapped into
a subquery with an explicit list of columns. This wrapping is necessary
in some cases when a Postgres-side `CAST` is required for particular
column. But it can be omitted in most of the usual cases.

This PR enables the wrapping of the user query only when necessry.

Ref: duckdblabs/duckdb-internal#11178
@staticlibs
staticlibs merged commit 4f73f18 into duckdb:main Oct 15, 2026
7 checks passed
@staticlibs
staticlibs deleted the query_wrap branch October 15, 2026 13:16
carlopi pushed a commit to maiadegraaf/duckdb that referenced this pull request Oct 15, 2026
This PR updates Postgres and SQLite bringing in the following fixes:

Postgres:

 - duckdb/duckdb-postgres#617

 - duckdb/duckdb-postgres#620

 - duckdb/duckdb-postgres#621

SQLite:

 - duckdb/duckdb-sqlite#256

 - duckdb/duckdb-sqlite#258

Additonally SQLite patch `0003-check-file-access-of-local-databases` is
absorbed.
carlopi pushed a commit to maiadegraaf/duckdb that referenced this pull request Oct 15, 2026
This PR updates Postgres and SQLite bringing in the following fixes:

Postgres:

 - duckdb/duckdb-postgres#617

 - duckdb/duckdb-postgres#620

 - duckdb/duckdb-postgres#621

SQLite:

 - duckdb/duckdb-sqlite#256

 - duckdb/duckdb-sqlite#258

Additonally SQLite patch `0003-check-file-access-of-local-databases` is
absorbed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant