You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to migrate a continuous aggregate to finalized form.
If the time column is timestamp without time zone, attempt to migrate fails with the following error:
ERROR: Invalid data type timestamp without time zone for time bucket
CONTEXT: PL/pgSQL function _timescaledb_internal.cagg_migrate_execute_refresh_new_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) line 17 at RAISE
SQL statement "CALL _timescaledb_internal.cagg_migrate_execute_refresh_new_cagg($1, $2)"
PL/pgSQL function _timescaledb_internal.cagg_migrate_execute_plan(_timescaledb_catalog.continuous_agg) line 31 at EXECUTE
SQL statement "CALL _timescaledb_internal.cagg_migrate_execute_plan(_cagg_data)"
PL/pgSQL function cagg_migrate(regclass,boolean,boolean) line 25 at CALL
TimescaleDB version affected
2.8.1
PostgreSQL version used
13.8
What operating system did you use?
Fedora
What installation method did you use?
Not applicable
What platform did you run on?
Managed Service for TimescaleDB (MST/Aiven)
Relevant log output and stack trace
CONTEXT: PL/pgSQL function_timescaledb_internal.cagg_migrate_execute_refresh_new_cagg(_timescaledb_catalog.continuous_agg,_timescaledb_catalog.continuous_agg_migrate_plan_step) line 17 at RAISE SQL statement "CALL _timescaledb_internal.cagg_migrate_execute_refresh_new_cagg($1, $2)" PL/pgSQL function_timescaledb_internal.cagg_migrate_execute_plan(_timescaledb_catalog.continuous_agg) line 31 at EXECUTE SQL statement "CALL _timescaledb_internal.cagg_migrate_execute_plan(_cagg_data)" PL/pgSQL functioncagg_migrate(regclass,boolean,boolean) line 25 at CALL
ERROR: Invalid data type timestamp without time zone fortime bucket
### How can we reproduce the bug?
```bash
--DROP TABLE test_table;
create table test_table (
device_id bigint not null,
reading numeric not null,
time_ts timestamp without time zone not null
);
create index test_table_time_ts_idx on test_table(time_ts desc);
--> single node hypertable
select create_hypertable('test_table', 'time_ts', chunk_time_interval => INTERVAL '1 day');
--> (0) data
--delete from test_table;
INSERT INTO test_table (device_id, reading, time_ts)
SELECT
cast(random() * 50 as int) + 1,
generate_series(1,8467201),
generate_series(
now() - INTERVAL '98 days',
now(),
INTERVAL '1 second'
);
--> (1) Create a cagg the old way - 'timescaledb.finalized = false'
--drop materialized view test_table_cagg;
CREATE MATERIALIZED VIEW test_table_cagg
WITH (timescaledb.continuous, timescaledb.finalized = false) AS
select
time_bucket('1 hour', time_ts) as bucket,
device_id,
sum(reading) as sum_total,
avg(reading) as avg_reading,
max(reading) as max_reading
from test_table
group by device_id, bucket;
--> (2) initiate migration here
call cagg_migrate('test_table_cagg', override => true);
The text was updated successfully, but these errors were encountered:
It was a leftover from the original implementation where we didn't add
tests for time dimension using `timestamp without timezone`.
Fixed it by dealing with this datatype and added regression tests.
Fixestimescale#4956
It was a leftover from the original implementation where we didn't add
tests for time dimension using `timestamp without timezone`.
Fixed it by dealing with this datatype and added regression tests.
Fixestimescale#4956
It was a leftover from the original implementation where we didn't add
tests for time dimension using `timestamp without timezone`.
Fixed it by dealing with this datatype and added regression tests.
Fixestimescale#4956
It was a leftover from the original implementation where we didn't add
tests for time dimension using `timestamp without timezone`.
Fixed it by dealing with this datatype and added regression tests.
Fixes#4956
What type of bug is this?
Unexpected error
What subsystems and features are affected?
Continuous aggregate
What happened?
Trying to migrate a continuous aggregate to finalized form.
If the time column is timestamp without time zone, attempt to migrate fails with the following error:
TimescaleDB version affected
2.8.1
PostgreSQL version used
13.8
What operating system did you use?
Fedora
What installation method did you use?
Not applicable
What platform did you run on?
Managed Service for TimescaleDB (MST/Aiven)
Relevant log output and stack trace
The text was updated successfully, but these errors were encountered: