2

I use this query to create a continuous aggregate on one of my hypertables:

CREATE MATERIALIZED VIEW logschema."aggregateValveMovementDaily" WITH (timescaledb.continuous) AS
    SELECT "ID",
           time_bucket('1 day', "hour") as "day",
           COUNT("ID") as "messageCount",
           min("movement") as "movement_min"
    FROM logschema."movementHourly"
    GROUP BY "ID", "day"
WITH NO DATA;

But the View is populated with data which is exactly what I don't want because we have alot of data which we want to migrate manually.
How can I just get an empty table which I can later fill with data?

Paul Müller
  • 103
  • 8
  • Is it actually filling in data, or are you getting results due to real-time aggregation https://docs.timescale.com/timescaledb/latest/how-to-guides/continuous-aggregates/real-time-aggregates/ – TDF Nov 17 '21 at 13:11
  • its actually filling in, I added the data manually with a timestamp from last week and it still filled the data into the table – Paul Müller Nov 17 '21 at 14:04
  • 3
    I think you'll need to actually disable the real time aggregation to achieve it: `ALTER MATERIALIZED VIEW logschema."aggregateValveMovementDaily" set (timescaledb.materialized_only = true);` – jonatasdp Nov 17 '21 at 15:50
  • Thanks that helped alot, its working now! – Paul Müller Nov 17 '21 at 21:13

0 Answers0