timescaledb/sql/updates/latest-dev.sql
Sven Klemm cbda1acd4f Record cagg view state in catalog
Record materialized_only state of continuous aggregate view in
catalog and show state in timescaledb_information.continuous_aggregates.
2020-04-14 06:57:33 +02:00

13 lines
593 B
SQL

DROP VIEW IF EXISTS timescaledb_information.continuous_aggregates;
ALTER TABLE IF EXISTS _timescaledb_catalog.continuous_agg ADD COLUMN IF NOT EXISTS materialized_only BOOL NOT NULL DEFAULT false;
-- all continuous aggregrates created before this update had materialized only views
UPDATE _timescaledb_catalog.continuous_agg SET materialized_only = true;
-- rewrite catalog table to not break catalog scans on tables with missingval optimization
CLUSTER _timescaledb_catalog.continuous_agg USING continuous_agg_pkey;
ALTER TABLE _timescaledb_catalog.continuous_agg SET WITHOUT CLUSTER;