improve SET CONSTRAINTS - Mailing list pgsql-patches

From Neil Conway
Subject improve SET CONSTRAINTS
Date
Msg-id 87r8hagr81.fsf@klamath.dyndns.org
Whole thread Raw
Responses Re: improve SET CONSTRAINTS
List pgsql-patches
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

Attachment

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: CLUSTER patch and regression test
Next
From: Tom Lane
Date:
Subject: Re: CLUSTER patch and regression test