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
Reorder fails to convert column references in the used index from the hypertable to the chunk attributes leading to wrong results or spurious errors when the index references columns with different attnum between chunk and hypertable.
To reproduce:
dev=# create table o(c1 timestamptz,c2 text, c3 text);
CREATE TABLE
Time: 17.549 ms
dev=# select create_hypertable('o','c1');
NOTICE: 00000: adding not-null constraint to column "c1"
DETAIL: Time dimensions cannot have NULL values.
LOCATION: dimension_add_not_null_on_column, dimension.c:1055
create_hypertable
-------------------
(7,public,o,t)
(1 row)
Time: 31.077 ms
dev=# alter table o drop column c2;
ALTER TABLE
Time: 19.402 ms
dev=# alter table o add column c4 text;
ALTER TABLE
Time: 7.055 ms
dev=# create unique index on o(c1,c4);
CREATE INDEX
Time: 18.790 ms
dev=# insert into o select '2000-01-01','foo','foo';
INSERT 0 1
Time: 53.000 ms
dev=# insert into o select '2000-01-01','foo','bar';
INSERT 0 1
Time: 8.321 ms
dev=# select reorder_chunk('_timescaledb_internal._hyper_7_2580_chunk','o_c1_c4_idx');
ERROR: 23505: could not create unique index "pg_temp_5257022__hyper_7_2580_chunk_o_c1_c4_idx"
DETAIL: Key (c1, c3)=(2000-01-01 00:00:00+01, foo) is duplicated.
SCHEMA NAME: _timescaledb_internal
TABLE NAME: pg_temp_5257022
CONSTRAINT NAME: pg_temp_5257022__hyper_7_2580_chunk_o_c1_c4_idx
LOCATION: comparetup_index_btree, tuplesort.c:4219
Time: 38.982 ms
The text was updated successfully, but these errors were encountered:
When we clone an index from a chunk we must not do attnum mapping if the
supplied index template is not on the hypertable. Ideally we would check
for the template being on the chunk but we cannot do that since when we
rebuild a chunk the new chunk has a different id.
Fixestimescale#3651
When we clone an index from a chunk we must not do attnum mapping if the
supplied index template is not on the hypertable. Ideally we would check
for the template being on the chunk but we cannot do that since when we
rebuild a chunk the new chunk has a different id.
Fixestimescale#3651
svenklemm
added a commit
to svenklemm/timescaledb
that referenced
this issue
Oct 6, 2021
When we clone an index from a chunk we must not do attnum mapping if the
supplied index template is not on the hypertable. Ideally we would check
for the template being on the chunk but we cannot do that since when we
rebuild a chunk the new chunk has a different id.
Fixestimescale#3651
When we clone an index from a chunk we must not do attnum mapping if the
supplied index template is not on the hypertable. Ideally we would check
for the template being on the chunk but we cannot do that since when we
rebuild a chunk the new chunk has a different id.
Fixes#3651
Reorder fails to convert column references in the used index from the hypertable to the chunk attributes leading to wrong results or spurious errors when the index references columns with different attnum between chunk and hypertable.
To reproduce:
The text was updated successfully, but these errors were encountered: