This patch improves the behavior of SET CONSTRAINTS so that it
complies with the SQL99 standard, as discussed earlier on
-patches. According to SQL99, setting a constraint to IMMEDIATE needs
to take effect retroactively: any outstanding deferred modifications
need to be checked when the constraint mode is changed, not when the
transaction commits.
I also took the opportunity to remove a bunch of code in trigger.c
that wasn't doing anything useful, AFAICS -- according to SQL99, SET
CONSTRAINTS should only apply to the current transaction. So if we're
not inside a transaction block currently, SET CONSTRAINTS can return
immediately. I also wrote some regression tests for deferred
constraints, as well as the new behavior implemented by this patch.
I updated the documentation, and all the regression tests pass.
Cheers,
Neil
--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC