What is the equivalent for coalesce
in the new jOOQ 3.14 SQL/JSON supporting version (in PostgreSQL)?
select coalesce(json_agg(t.*), '[]'::json)
from (select 'test' as mycol where 1 = 2) t;
The following unfortunately fails with the error "COALESCE types json and uuid[] cannot be matched".
coalesce(jsonArrayAgg(mycol), emptyArray<type>())