pg_duckdb icon indicating copy to clipboard operation
pg_duckdb copied to clipboard

Add `postgres_mode` to DuckDB that makes it simulate Postgres in a better capacity

Open Mytherin opened this issue 1 year ago • 3 comments

This mode is a (very long tail) mode that improves compatibility between DuckDB's SQL dialect and Postgres' SQL dialect.

e.g.:

  • SELECT COUNT(*) FROM tbl returns a column named count, instead of count_star()

Mytherin avatar May 27 '24 15:05 Mytherin

Another issue is related to return types of table functions, as these need to be provided in Postgres, e.g.:

SELECT * FROM read_parquet('file.parquet') AS (t INT);

Mytherin avatar May 27 '24 15:05 Mytherin

Just to comment on your example. In case of SELECT * AS part should have all columns named with expected type.

But, for minimum i would expect that columns that are going to be used in query should be specified which is already forced by parser. It would be nice specified columns should match column names in parquet file.

SELECT a, b FROM read_parquet('file.parquet)' AS (a INT, B TEXT)

Also note that this issue is more cosmetic than functional (so expecting to be on low priority).

mkaruza avatar May 27 '24 15:05 mkaruza

https://github.com/hydradatabase/pg_quack_internal/issues/67

Tishj avatar Jul 10 '24 08:07 Tishj

I think all the things in this issue have now been solved/worked around some other way. We might still need a "postgres_mode" feature in duckdb for other reasons, but let's create separate issues for these things when we find them.

JelteF avatar Sep 30 '24 14:09 JelteF