AntiPattern

SQL JSON Shaping Mismatch

sql-json-shaping-mismatch

JSONB/JSON set-based operations fail because queries build the wrong row shape or cast/merge JSON with non-matching types, causing subqueries to collapse to one row, arrays to become scalar lists, or updates to overwrite instead of merge.