Hey everyone, I have a self hosted deployment of Timescale version pg13.8-ts2.8.0.
In July, I had to do some data migration, re-instate the database and move existing data into it etc. It was a mess, but I managed to do it eventually.
I’ve recently noticed that since then queries on my hypertables aren’t as smooth as they used to be.
My assumption is that in that process my existing hypertables exist in a sort of limbo, where they have old chunks when they were actually hypertables, but no new chunks have been generated since then.
When I select * from timescaledb_information.hypertables
I get 0 rows.
When I try to create a hypertable from an existing table table_a
(which used to be a hypertable) like so:
SELECT create_hypertable('table_a, 'timestamp', migrate_data => TRUE);
I get the following error message:
SQL Error [0A000]: ERROR: table "table_a" is already partitioned Detail: It is not possible to turn tables that use inheritance into hypertables.
When I manually check the child tables of that table, I see a bunch of chunks, last of which is dated in July.
Adding more context: the newly created hypertables don’t have child tables at all, however, they both dependencies. (I’m checking this using dbeaver)
As I’ve already mentioned, this table, which should already be a hypertable and used to be a hypertable, no longer is one.
One idea I’ve had is to:
- create a new
table_b
liketable_a
- make
table_b
a hypertable - move data from
table_a
totable_b
- move all the constraints and foreign keys as well (this part I’m trying to avoid)
- rename
table_a
totable_a_backup
- rename
table_b
totable_a
Is there a more elegant way to go about this? I really dislike my current approach seems to be a bit too risky and cumbersome to preform.
Would appreciate any advice and guidance to handle this situation.