-
Notifications
You must be signed in to change notification settings - Fork 21
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
operation not supported on hypertables that have compression enabled #100
Comments
@johntdyer compressed chunks in Timescale can't be updated or deleted, so updating to 2.1.0, which modifies the structure of the hypertable, can only be done on an uncompressed database. Afterwards you can enable compression again, which should also be much more effective without the id column. See https://docs.timescale.com/api/latest/compression/decompress_chunk/ for details on decompressing your database. |
got caught out by this one too. Though infact at first glance it seems unrelated to compression (it's disabled). |
@antoonhuiskens Could you share some more details? What error message did you get, since the error that @johntdyer got is related to having compression enabled as indicated by the title of this issue? |
Hi, i'm in the same situation. I have decompressed all the tables, as you can see and i have disabled compression.
This is the error i have, after restarting HA. Logger: custom_components.ltss Error during connection setup: (psycopg2.errors.FeatureNotSupported) operation not supported on hypertables that have compression enabled [SQL: ALTER TABLE ltss DROP CONSTRAINT ltss_pkey CASCADE, ADD PRIMARY KEY(time,entity_id);] (Background on this error at: https://sqlalche.me/e/20/tw8g) (retrying in 3 seconds) |
SOLUTION for everyone having this problem In pgAdmin give this command. alter table ltss set (timescaledb.compress=false); Restart HomeAssistant and wait for the migration to complete. Then you have to re-enable the compression. |
@shakin89 Thanks for sorting this out. I didn't get around to looking into this further, but it looks like TimescaleDB only allows modifications to the schema when all chunks are decompressed and compression is disabled on the hypertable. @freol35241 Is there a way to include this as a note in the readme on hacs without bumping the version number? I don't think we should include this as a command in the migration, since it will force decompression of the database which might result in disk space issues upon migration and alters modifications that were made manually by users. |
@nwerter No, not that I am aware of and I agree regarding not adding this solution to the migration code. But, I do think that we should add a try-catch in the migration code for this specific error with an added explanation on how to solve it. That can be considered as a patch version bump, which together with an updated readme should help people to get through the version upgrade. What do you think? |
Sounds good, I'll try to have a look at this over the weekend
Sounds good, I'll try to have a look at this over the weekend. |
Have a issue after decompressing with the
And when listing Constraint, there is no ltss_pkey in my setup?
|
Did you make any manual modifications to the primary keys of the database yourself? In setting up the database, the primary keys are automatically created normally so should be present as constraints in the database. The command DROP CONSTRAINT is meant to drop the original primary keys such that a new set of primary keys without the id column can be created. |
I have not, Im not great at SQL so I try to not mess arround in it |
@Coffee0297 Can you please give some more details on you current ltss table setup?
|
Can you give some example SQL commands to lidt those? Not good at SQL and deff not the setup there is in timescale/postgresql |
I think the easiest is to make use of the built-in
|
@freol35241 Haha I was working on a new version of the TimescaleDB addon, and I also bumped into this issue.. I thought it was my own doing... I will decompress... no worry :) |
Ok. Just had another go at upgrading:
Checking on compression:
I'm not sure why the ltss_constraint doesn't exist. I'd say that adding IF EXISTS to the ALTER TABLE statement would fix this. Doesn't look to be related to role permissions either:
raised issue #111 for this. |
@antoonhuiskens Agreed, in hindsight using DROP CONSTRAINT IF EXISTS would have been a better solution, which I see you already created a pull request for, thanks. I'm still planning to include a proper try/catch statement for the complete migration to 2.1.0, but am in the middle of moving houses, so haven't got around to that yet. |
Homeassistant 2023.06.01
LTSS 2.1.0
Error at startup
The text was updated successfully, but these errors were encountered: