When I'm trying to create materialized view for existing table by query:
CREATE MATERIALIZED VIEW current_data_hourly
WITH (timescaledb.continuous) AS
SELECT id,
time_bucket(INTERVAL '1 hour', creation_time) AS creation_time,
AVG(current_abs_1_avg),
MAX(current_abs_1_max),
MIN(current_abs_1_min)
FROM time_series.current_data
GROUP BY id, creation_time;
I'm getting:
ERROR: continuous aggregate view must include a valid time bucket function
SQL state: XX000
Any suggestions what could be wrong?