Skip to content

Tag: postgresql-json

Coalesce jsonArrayAgg to empty array in jOOQ

What is the equivalent for coalesce in the new jOOQ 3.14 SQL/JSON supporting version (in PostgreSQL)? The following unfortunately fails with the error “COALESCE types json and uuid[] cannot be matched”. Answer JSON.json() or JSONB.jsonb(), e.g.: But you can also use the jsonArray() or jsonbArray() constructors: