Search Shortcut cmd + k | ctrl + k
Search cmd+k ctrl+k
1.0 (stable)
PostgreSQL Compatibility

DuckDB’s SQL dialect closely follows the conventions of the PostgreSQL dialect. The few exceptions to this are listed on this page.

UNION of Boolean and Integer Values

The following query fails in PostgreSQL but successfully completes in DuckDB:

SELECT true AS x
UNION
SELECT 2;

PostgreSQL returns an error:

ERROR:  UNION types boolean and integer cannot be matched

DuckDB performs an enforced cast, therefore, it completes the query and returns the following:

x
1
2
About this page

Last modified: 2024-06-12