What type of bug is this?
Crash
What subsystems and features are affected?
Compression, Continuous aggregate
What happened?
When renaming a column on a continuous aggregate that has compression enabled, tsl_process_compress_table_rename_column() receives a RenameStmt with relationType == OBJECT_MATVIEW (because the user is altering a materialized view), but the assertion requires OBJECT_TABLE. This causes SIGABRT.
TimescaleDB version affected
2.28.0
PostgreSQL version used
17.4
What operating system did you use?
ubuntu 24.04
What installation method did you use?
Source
What platform did you run on?
Other
Relevant log output and stack trace
How can we reproduce the bug?
-- Bug: Assertion failure when renaming a column on a continuous aggregate
-- that has compression enabled.
--
-- tsl/src/compression/create.c:2384 asserts stmt->relationType == OBJECT_TABLE
-- but receives OBJECT_MATVIEW when the rename targets a continuous aggregate.
-- This causes SIGABRT (assertion failure / XX000).
CREATE TABLE src(ts timestamptz NOT NULL, val double precision);
SELECT create_hypertable('src', 'ts');
CREATE MATERIALIZED VIEW cagg WITH (timescaledb.continuous) AS
SELECT time_bucket('1 day', ts) AS bucket, avg(val) AS avg_val
FROM src GROUP BY 1 WITH NO DATA;
ALTER MATERIALIZED VIEW cagg SET (
timescaledb.compress,
timescaledb.compress_orderby = 'bucket'
);
-- Triggers assertion failure at tsl/src/compression/create.c:2384:
-- Assert(stmt->relationType == OBJECT_TABLE && stmt->renameType == OBJECT_COLUMN)
-- stmt->relationType is OBJECT_MATVIEW, not OBJECT_TABLE.
ALTER MATERIALIZED VIEW cagg RENAME COLUMN avg_val TO average_value;
What type of bug is this?
Crash
What subsystems and features are affected?
Compression, Continuous aggregate
What happened?
When renaming a column on a continuous aggregate that has compression enabled,
tsl_process_compress_table_rename_column()receives a RenameStmt with relationType == OBJECT_MATVIEW (because the user is altering a materialized view), but the assertion requires OBJECT_TABLE. This causes SIGABRT.TimescaleDB version affected
2.28.0
PostgreSQL version used
17.4
What operating system did you use?
ubuntu 24.04
What installation method did you use?
Source
What platform did you run on?
Other
Relevant log output and stack trace
How can we reproduce the bug?