1
0
mirror of https://github.com/timescale/timescaledb.git synced 2025-05-17 02:53:51 +08:00

Fix continuous aggregate migrate check constraint

Instances upgraded to 2.8.0 will end up with a wrong check constraint
in catalog table `continuous_aggregate_migrate_plan_step`.

Fixed it by removing and adding the constraint with the correct checks.

Fix 
This commit is contained in:
Fabrízio de Royes Mello 2022-09-21 10:15:32 -03:00
parent 4cb38350c6
commit 217f514657
3 changed files with 18 additions and 0 deletions

@ -24,10 +24,12 @@ argument or resolve the type ambiguity by casting to the intended type.
* #4685 Improve chunk exclusion for space dimensions
* #4696 Report warning when enabling compression on hypertable
* #4676 Fix a deadlock when decompressing chunks and performing SELECTs
* #4739 Fix continuous aggregate migrate check constraint
**Thanks**
* @maxtwardowski for reporting problems with chunk exclusion and space dimensions
* @yuezhihan for reporting GROUP BY error when setting compress_segmentby with an enum column
* @carobme for reporting constraint error during continuous aggregate migration
## 2.8.0 (2022-08-30)

@ -46,3 +46,11 @@ BEGIN
WHERE mat_hypertable_id OPERATOR(pg_catalog.=) _cagg_data.mat_hypertable_id;
END;
$BODY$;
-- Issue #4727
ALTER TABLE _timescaledb_catalog.continuous_agg_migrate_plan_step
DROP CONSTRAINT IF EXISTS continuous_agg_migrate_plan_step_check2;
ALTER TABLE _timescaledb_catalog.continuous_agg_migrate_plan_step
ADD CONSTRAINT continuous_agg_migrate_plan_step_check2
CHECK (type IN ('CREATE NEW CAGG', 'DISABLE POLICIES', 'COPY POLICIES', 'ENABLE POLICIES', 'SAVE WATERMARK', 'REFRESH NEW CAGG', 'COPY DATA', 'OVERRIDE CAGG', 'DROP OLD CAGG'));

@ -45,3 +45,11 @@ BEGIN
WHERE mat_hypertable_id OPERATOR(pg_catalog.=) _cagg_data.mat_hypertable_id;
END;
$BODY$;
-- Issue #4727
ALTER TABLE _timescaledb_catalog.continuous_agg_migrate_plan_step
DROP CONSTRAINT IF EXISTS continuous_agg_migrate_plan_step_check2;
ALTER TABLE _timescaledb_catalog.continuous_agg_migrate_plan_step
ADD CONSTRAINT continuous_agg_migrate_plan_step_check2
CHECK (type IN ('CREATE NEW CAGG', 'DISABLE POLICIES', 'COPY POLICIES', 'ENABLE POLICIES', 'SAVE WATERMARK', 'REFRESH NEW CAGG', 'COPY DATA'));