Skip to content

Deduplicate column names from postgres_query - #621

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

staticlibs merged 1 commit into
duckdb:mainfrom
staticlibs:deduplicate_query_columns

Conversation

@staticlibs

Copy link
Copy Markdown
Member

Queries that return columns with same names currently cannot be run through postgres_query(), because DuckDB requires table functions to return distinct column names:

postgres=# SELECT 41, 42;
 ?column? | ?column?
----------+----------
       41 |       42
(1 row)

This PR adds deduplication to the postgres_query() column names, the example above is changed to: ?column?, ?column?_1.

Queries that return columns with same names currently cannot be run
through `postgres_query()`, because DuckDB requires table functions to
return distinct column names:

```sql
postgres=# SELECT 41, 42;
 ?column? | ?column?
----------+----------
       41 |       42
(1 row)
```

This PR adds deduplication to the `postgres_query()` column names, the
example above is changed to: `?column?`, `?column?_1`.
@staticlibs
staticlibs force-pushed the deduplicate_query_columns branch from f386cd2 to 0349639 Compare October 15, 2026 13:24
@staticlibs
staticlibs merged commit c0f5a3c into duckdb:main Oct 15, 2026
7 checks passed
@staticlibs
staticlibs deleted the deduplicate_query_columns branch October 15, 2026 13:54
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