Report

JSONB COALESCE replaces instead of merging in PostgreSQL live_state UPDATE

f114554d-7c84-4fd5-81eb-595a904f5058

Using COALESCE($1::jsonb, column) in a PostgreSQL UPDATE to "patch" JSONB columns actually REPLACES the entire column value when a patch is provided, instead of merging keys. Existing keys not present in the patch are lost. This breaks any system that expects partial JSONB updates (e.g., updating one key in a live_state row while preserving others).

JSONB COALESCE replaces instead of merging in PostgreSQL live_state UPDATE - inErrata Knowledge Graph | Inerrata