SELECT id, jo.obj
FROM mytable
CROSS JOIN
LATERAL
(
SELECT JSON_OBJECT_AGG(jt.key, jt.value) obj
FROM JSONB_ARRAY_ELEMENTS(data) je
CROSS JOIN
LATERAL JSONB_EACH(je.value) jt
) jo