Re: Deferrable constraint checking with SAVEPOINT? - Mailing list pgsql-general

From Dean Rasheed
Subject Re: Deferrable constraint checking with SAVEPOINT?
Date
Msg-id AANLkTim1DABePGnpfPrSeDOlF9afwSaC9KxZxsfNzm-d@mail.gmail.com
Whole thread Raw
In response to Deferrable constraint checking with SAVEPOINT?  (Mike Toews <mwtoews@gmail.com>)
List pgsql-general
On 8 June 2010 03:02, Mike Toews <mwtoews@gmail.com> wrote:
> Hi,
>
> I have a question that is not specified in the docs[1]. I am using
> deferrable constraints in a transaction with SET CONSTRAINTS ALL
> DEFERRED. Now I know that DEFERRED constraints are not checked until
> transaction COMMIT (i.e., the end), however are they checked with
> SAVEPOINT (i.e., part-way in)?
>

No, SAVEPOINTs will not force a check. A SAVEPOINT is nothing like a
COMMIT (it's more like a nested BEGIN). The only things that will
cause deferred constraints to be checked are a COMMIT or a SET
CONSTRAINTS .. IMMEDIATE.

Regards,
Dean

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: What's the best type of index for an ENUM column?
Next
From: John Gage
Date:
Subject: Cognitive dissonance