6 Commits

Author SHA1 Message Date
Sven Klemm
98668b8dea Sync FK behaviour when creating hypertable
We now allow FKs to hypertables but the initial check when creating
the hypertable was not adjusted so tables with pre-existing FKs
would not be allowed to be changed into hypertable while creating
the FK constraint afterwards succeeded.
2024-09-30 10:49:12 +02:00
Sven Klemm
887aed904f Fix FK constraint where index and constraint column order differ
The code for finding the constraint index was expecting the index
columns to be in the same order as the constraint columns. This
patch changes the check to require all columns be present independent
of the order.

Fixes #7226
2024-09-04 13:32:52 +02:00
Sven Klemm
4ebbd85b68 Allow DELETE on compressed chunks without decompression
When the constraints of a DELETE on a compressed chunks fully cover the
batches we can optimize the DELETE to work directly on the compressed
batches and skip the expensive decompression part. This optimization
is disabled when we detect any JOINs.
2024-08-10 13:10:17 +02:00
Sven Klemm
af6b4a3911 Change hypertable foreign key handling
Don't copy foreign key constraints to the individual chunks and
instead modify the lookup query to propagate to individual chunks
to mimic how postgres does this for partitioned tables.
This patch also removes the requirement for foreign key columns
to be segmentby columns.
2024-07-22 14:33:00 +02:00
Sven Klemm
6d83e0584d Add more tests for foreign key constraints on hypertables 2024-07-18 11:57:57 +02:00
Sven Klemm
6defa15c8d Add support for foreign keys to hypertables
Currrently we only allow Hypertables references other tables, with
this patch the opposite direction is supported as well and tables
can have foreign key references into hypertables.
2024-06-18 17:54:33 +02:00