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
We have started to use compress_chunk_time_interval with to column partitioning (in addition to time column), and after using it we have seen a new error regarding a constraint we are not aware of. When we try to insert a new row we get error:
It seems that it sometimes allows use to insert duplicates into compressed tables.
Unique index has always been there so it does not make sense how it could have happened.
We are unable to decompress the chunk as it does not adhere to unique index constraints.
TimescaleDB version affected
2.7.0
PostgreSQL version used
16
What operating system did you use?
Stackgres
What installation method did you use?
Not applicable
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
How can we reproduce the bug?
Our insert:
INSERT INTO test (columns) VALUES (values) ON CONFLICT DO NOTHING;
Our setup:
CREATE TABLE test (
idINTEGER NOT NULL,
d TIMESTAMPTZ NOT NULL,
v DECIMAL(15, 3) NOT NULL,
issue_datetime_utc TIMESTAMPTZ NULL,
extract_datetime_utc TIMESTAMPTZ NOT NULL,
computed_issue_datetime TIMESTAMPTZ GENERATED ALWAYS AS
(COALESCE(issue_datetime_utc, extract_datetime_utc)) STORED
);
SELECT create_hypertable('test', by_range('d', interval '185 days'));
SELECT add_dimension('test', by_hash('id', 512));
CREATE UNIQUE INDEX actuals_curve_id_d_computed_issue_datetime_key
ON archive.actuals (curve_id, d DESC, computed_issue_datetime DESC);
ALTER TABLE test
SET (
timescaledb.compress,
timescaledb.compress_segmentby = 'id',
timescaledb.compress_orderby = 'd, computed_issue_datetime DESC',
-- Factor of original chunk size
timescaledb.compress_chunk_time_interval = '740 days'
);
The text was updated successfully, but these errors were encountered:
ArosTRM
changed the title
[Bug]: <Title> Compress_chunk_time_interval weird behavior over chunk interval
[Bug]: Compress_chunk_time_interval weird behavior over chunk interval
Feb 19, 2025
ArosTRM
changed the title
[Bug]: Compress_chunk_time_interval weird behavior over chunk interval
[Bug]: Compress_chunk_time_interval fails to adhere to unique indexes.
Mar 3, 2025
What type of bug is this?
Unexpected error
What subsystems and features are affected?
Data ingestion
What happened?
We have started to use compress_chunk_time_interval with to column partitioning (in addition to time column), and after using it we have seen a new error regarding a constraint we are not aware of. When we try to insert a new row we get error:
Error: new row for relation “_hyper_198_440400_chunk” violates check constraint “constraint_427027”
DETAIL: Failing row contains (26213, 2021-02-26 07:00:00+00, 0.000, 2024-09-17 12:45:34.327421+00, 2025-02-18 13:34:18.674494+00, 2024-09-17 12:45:34.327421+00).
It seems that it sometimes allows use to insert duplicates into compressed tables.
Unique index has always been there so it does not make sense how it could have happened.
We are unable to decompress the chunk as it does not adhere to unique index constraints.
TimescaleDB version affected
2.7.0
PostgreSQL version used
16
What operating system did you use?
Stackgres
What installation method did you use?
Not applicable
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: