-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclusion constraint miscalculation #694
Comments
Confirmed this bug. Thanks for reporting! |
Thanks again for reporting this! Issue was just in the I'm also working on clarifying the documentation on how to use this feature as well. |
Hi Keith, |
Actually, I've reworked the logic in both the Thank you! |
If you are able to test in a development environment, the |
Version 5.2.0 has been released with this fix. Thanks again for reporting the issue! |
On new partition sets without any "old" partitions, exclusion constraints are created on the current partition, regardless of the optimize_constraint setting.
This does happen, if an existing table is attached as default parittion.
v_child_stop is calculated like this:
But there isn't any Partition for 20240801:
The raise condition
IF v_row.partition_tablename = v_child_stop THEN
does not match and exclusion constraints are created on the "current" partition aggregation_value_p20241001.Proposed solution:
check, if v_child_stop is a partition of the parent_table before applying any constraints:
select true from partman.show_partitions('fc.aggregation_value') where partition_tablename='aggregation_value_p20240801';
The text was updated successfully, but these errors were encountered: