add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
create table test (observation jsonb);
insert into test values ('[{"a": 1}, {"b": 2}, {"c": 0.5}]'::jsonb);
CREATE TABLE
INSERT 0 1
select jsonb_agg((select jsonb_object_agg(k1.key, k1.value)
from jsonb_array_elements(t.observation) k
cross join jsonb_each(k.value) k1))
from test t
jsonb_agg
[{"a": 1, "b": 2, "c": 0.5}]
SELECT 1