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?.
with t(t, h) as (values
('2000-01-01 01:01:01'::timestamp, 'a=>1,b=>2'::hstore),
('2000-01-01 01:01:02', 'a=>3'),
('2000-01-01 01:02:03', 'b=>4'),
('2000-01-01 01:02:05', 'a=>2,b=>3'))
select
date_trunc('minute', t),
jsonb_object_agg(k, v order by t)
from t, each(h) as h(k,v)
group by date_trunc('minute', t);
date_trunc jsonb_object_agg
2000-01-01 01:01:00 {"a": "3", "b": "2"}
2000-01-01 01:02:00 {"a": "2", "b": "3"}