Hello
- if (cmdcon->alterEnforceability &&
- ATExecAlterFKConstrEnforceability(wqueue, cmdcon, conrel, tgrel,
- currcon->conrelid, currcon->confrelid,
- contuple, lockmode, InvalidOid,
- InvalidOid, InvalidOid, InvalidOid))
+ if (cmdcon->alterEnforceability)
+ {
+ if (currcon->contype == CONSTRAINT_FOREIGN)
+ ATExecAlterFKConstrEnforceability(wqueue, cmdcon, conrel, tgrel,
+ currcon->conrelid,
+ currcon->confrelid,
+ contuple, lockmode,
+ InvalidOid, InvalidOid,
+ InvalidOid, InvalidOid);
+ else if (currcon->contype == CONSTRAINT_CHECK)
+ ATExecAlterCheckConstrEnforceability(wqueue, cmdcon, conrel,
+ contuple, recurse, false,
+ lockmode);
changed = true;
Isn't this a behavior change?
With this change, "changed" is set to true regardless of the return
code of ATExecAlterFKConstrEnforceability (and
ATExecAlterCheckConstrEnforceability). Previously we only set it true
if ATExecAlterFKConstrEnforceability returned true (which means it
actually changed something).
I don't think this is visible anywhere outside the code, but wouldn't
it be better to keep the flag as it was previously?