On 2018-May-10, David Rowley wrote: > Yeah, the comments do need work. In order to make it a bit easier to > document I changed the way that check_partition_constr is set. This is > now done with an if/else if/else clause for both COPY and INSERT. > > Hopefully, that's easier to understand and prevents further mistakes.
I wonder if we should create a new small function that takes the two resultRelInfos and returns the correct boolean --maybe something like ExecConstraintsPartConstrNeedsRecheck()-- and then the smarts are in a single place and we diminish the risk of a divergence. It looks like a very ad-hoc thing to have a function for, but then the new argument to ExecConstraints() *is* pretty ad-hoc already, so encapsulating it seems better. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services