Open marcocitus opened 7 years ago
We no longer get SPI errors when creating a foreign key to a reference table that is replicated to the coordinator. However, ON UPDATE/DELETE do not work correctly. We should probably map the foreign key directly to the shard.
Because we only intercept
ALTER TABLE
commands that are performed on distributed tables, it's currently possible to create a foreign key on a regular table that points to a distributed table.Since foreign keys are implemented using SPI, Citus intercepts the underlying queries used to check whether the foreign key holds and throws errors because the queries are unsupported.
We could actually support these queries, with some risk of losing this feature when the underlying implementation in PostgreSQL changes. Otherwise, we should probably have a more appropriate error message.
(low priority, more of a curiosity)