postgres add object to jsonb array from the same column
ALTER TABLE items
ADD new_arrays_col jsonb DEFAULT '[]';
UPDATE items i1
SET new_arrays_col = new_arrays_col || JSON_BUILD_OBJECT(
'col1', col1,
'col1', col2
)::jsonbLast updated
ALTER TABLE items
ADD new_arrays_col jsonb DEFAULT '[]';
UPDATE items i1
SET new_arrays_col = new_arrays_col || JSON_BUILD_OBJECT(
'col1', col1,
'col1', col2
)::jsonbLast updated