How can I change column type from timestamp to timestamptz in TimescaleDB?
I used ingestion script outflux to get data from InfluxDB to TimescaleDB. This created tables that are using timestamp as their time column.
CREATE TABLE conditions (
time TIMESTAMP NOT NULL,
location TEXT NOT NULL,
temperature DOUBLE PRECISION NULL
);
I tried to convert it to timestamptz using standart alter command
alter table conditions
alter column "time" type timestamptz using ("time"::timestamptz)
But that produced following error
ERROR: check constraint "constraint_1007" of relation "_hyper_12_1007_chunk" is violated by some row
CONTEXT: SQL statement " ALTER TABLE _timescaledb_internal._hyper_12_1007_chunk ADD CONSTRAINT constraint_1007 CHECK ( "time" >= TIMESTAMPTZ '2020-12-03 01:00:00+01' AND "time" < TIMESTAMPTZ '2020-12-10 01:00:00+01' ) "
PL/pgSQL function _timescaledb_internal.chunk_constraint_add_table_constraint(_timescaledb_catalog.chunk_constraint) line 42 at EXECUTE
SQL state: 23514