Open m3hm3t opened 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.60%. Comparing base (
b29c332
) to head (765d397
).
Given that we lack in documentation right now, let me introduce this concept here as it's a good PR for it. For new things that PG allows, like an exclusion constraint on partitioned tables, first we make sure that it works as it is supposed to in Citus. If it does, our general practice is to create a new file to test it, namely
pg17.sql
where we add all such things. We will populate this file with other things as we go on with the support. (For this reason we havepg16.sql
pg15.sql
tests etc.) I will include this in the documentation for new PG support.With that in mind, could you adjust this PR accordingly? I don't think we need to add a new output file for
multi_alter_table_add_constraints
. Instead, we can createpg17.sql
file which will havepg17.out
andpg17_0.out
, and include this particular test case there. In this case, thepg17_0.out
file will have the errorexclusion constraints are not supported on partitioned tables
.
@naisila Can you review the solution? If it is acceptable, I will update the PR to prepare it for merging into the release branch.
In earlier versions of PostgreSQL, exclusion constraints were not allowed on partitioned tables. This is why the error in your regression test (ERROR: exclusion constraints are not supported on partitioned tables) was raised in PostgreSQL 16. In PostgreSQL 17, exclusion constraints are now allowed on partitioned tables, which is why the error no longer appears when you attempt to add an exclusion constraint.
The constraint exclusion mechanism, described in the documentation, relies on CHECK constraints to decide which partitions or child tables need to be queried.
CHECK constraints