pg_duckdb icon indicating copy to clipboard operation
pg_duckdb copied to clipboard

Convert DuckDB VARCHAR[] to PG TEXT[] to Prevent Type Mismatch

Open YuweiXiao opened this issue 3 months ago • 0 comments

DuckDB’s VARCHAR type is mapped to PostgreSQL TEXT, but its VARCHAR[] arrays were previously mapped to PostgreSQL VARCHAR[]. This inconsistency causes a type mismatch on the Postgres side during statistics analysis, triggering an assertion in array_typeanalyze.c::compute_array_stats:

Assert(ARR_ELEMTYPE(array) == extra_data->type_id)

This PR standardizes the behavior by converting DuckDB VARCHAR[] to PostgreSQL TEXT[].

A sample dataset is included to reproduce the original failure.

YuweiXiao avatar Nov 21 '25 09:11 YuweiXiao