-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating an index using transaction_per_chunk setting fails ifable contains an attribute that was dropped #2504
Comments
I tried running the blocking
|
@jocrau can you provide a test case for the transaction_per_chunk case. I could reproduce the 2nd error you got but not the first one. |
Thank you @svenklemm for fixing this. My apologies for not getting back with a test case for the |
We have upgraded TimescaleDB to v2.0.1, but the issue still persists:
|
Re-opening since there seems to be an issue still with This does seem to have been fixed for index creation without |
I ran the tests that cover the related PR in 1.7.4 and 2.0.1. It turns out that in 1.7.4 creating an index with
fails with
succeeds. The second case is the one we were running up against. Both cases succeed in 2.0.1. I believe the issue is, as I have pointed out in my initial post, "that the function
|
I have a working reproduction of this. It only happens when there's >1 chunk which does not align to the original hypertable schema, which is why this isn't caught by the current tests. This was done in 2.0.2 create table idx_create_error (time timestamp, a int, b int, c int, d int);
select create_hypertable('idx_create_error', 'time');
insert into idx_create_error VALUES
(now(), 1, 2, 3, 4);
ALTER TABLE idx_create_error DROP COLUMN b;
insert into idx_create_error (time, a, c, d) VALUES
(now() - interval '1 year', 1, 2, 3),
(now() - interval '2 years', 1, 2, 3);
create index idx2 ON idx_create_error (a,d) WITH (timescaledb.transaction_per_chunk) WHERE c IS NOT NULL; Results in:
|
The index creation code would take the IndexInfo from the hypertable and adjust it for the chunk but wouldnt reset IndexInfo for each individual chunk leading to errors when the hypertable has dropped columns. Fixes timescale#2504
The index creation code would take the IndexInfo from the hypertable and adjust it for the chunk but wouldnt reset IndexInfo for each individual chunk leading to errors when the hypertable has dropped columns. Fixes timescale#2504
The index creation code would take the IndexInfo from the hypertable and adjust it for the chunk but wouldnt reset IndexInfo for each individual chunk leading to errors when the hypertable has dropped columns. Fixes #2504
The index creation code would take the IndexInfo from the hypertable and adjust it for the chunk but wouldnt reset IndexInfo for each individual chunk leading to errors when the hypertable has dropped columns. Fixes timescale#2504
The index creation code would take the IndexInfo from the hypertable and adjust it for the chunk but wouldnt reset IndexInfo for each individual chunk leading to errors when the hypertable has dropped columns. Fixes #2504
Relevant system information:
postgres --version
): 11.9\dx
inpsql
): 1.7.4Describe the bug
I tried to create an index using the transaction_per_chunk setting running
but it fails with
It turns out that one of the attributes on the table was dropped:
That might be caused by the fact that the function
chunk_adjust_colref_attnos
does not check whether the attribute was dropped. (edited)The text was updated successfully, but these errors were encountered: