CREATE MATERIALIZED VIEW price
WITH (timescaledb.continuous) AS
select
time,
(row ->> 'price_id') as "price_id",
((row ->> 'price_state')::jsonb ->> 'price')::numeric as "price",
(row ->> 'conf')::numeric as "conf"
from attribute, jsonb_array_elements(value::jsonb) as row
WHERE event_kind = 'injective.oracle.v1beta1.EventSetPythPrices'
GROUP BY (time_bucket('00:00:01'::interval, "time")), "time", attribute.value, row;
Essentially the goal is to destructure a json element into multiple rows. This seems to be a fairly common use case that isn't supported.
What problem does the new feature solve?
Here's an example query:
Essentially the goal is to destructure a json element into multiple rows. This seems to be a fairly common use case that isn't supported.