[Bug]: drop_chunks
and _timescaledb_functions.drop_chunk
don't respect FKs against _timescaledb_catalog.chunk
#7269
Labels
What type of bug is this?
Data corruption
What subsystems and features are affected?
Other
What happened?
Our application needs to keep an index on a set of per-chunk values stored in compressed hypertable chunks. These values should be dropped when the chunk is dropped, so we created a foreign key from our table to the
_timescaledb_catalog.chunk
table. But when timescale drops chunks either on policy-driven schedule or manually viapublic.drop_chunks
/_timescaledb_functions.drop_chunk
, the foreign key constraint is not respected: chunk ids that are no longer valid continue to exist in the referencing table rather than being deleted on cascade as one would expect.TimescaleDB version affected
2.16.1
PostgreSQL version used
16.3
What operating system did you use?
Ubuntu 22.04 x64
What installation method did you use?
Deb/Apt, Docker
What platform did you run on?
On prem/Self-hosted
Relevant log output and stack trace
No response
How can we reproduce the bug?
The text was updated successfully, but these errors were encountered: