Unfortunately, it is not possible to add NOT VALID constraints to partitioned tables, so this strategy can only work when adding foreign keys to normal tables. It does work on partitions, so if a user really wanted to add foreign key constraints safely on a partitioned table, they could just add n foreign key constraints, one per partition, rather than just 1.
Description
Online foreign key support via
VALIDATE
.Unfortunately, it is not possible to add
NOT VALID
constraints to partitioned tables, so this strategy can only work when adding foreign keys to normal tables. It does work on partitions, so if a user really wanted to add foreign key constraints safely on a partitioned table, they could just add n foreign key constraints, one per partition, rather than just 1.Motivation
Fixes #97
Testing
Tested via acceptance tests