Re: Initially deferred constraints

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Mon, 08 Jun 2009 23:24:48 +0200
Message-ID: <795dt1F1p59cpU1_at_mid.individual.net>



On 08.06.2009 21:42, DeanB wrote:
> On Jun 8, 2:38 pm, DeanB <deanbrow..._at_yahoo.com> wrote:
>> On Jun 8, 12:35 pm, ddf <orat..._at_msn.com> wrote:
>>> On Jun 8, 10:16 am, dean <deanbrow..._at_yahoo.com> wrote:
>>>> Can anyone explain to me when a constraint can be deferred, but not
>>>> initially deferred? My understanding is that initially deferred does
>>>> not do its check until the close of a transaction, but I am not sure
>>>> what NOT initially deferred means.

DEFERRABLE INITIALLY IMMEDIATE basically means that the constraint may be deferred but is not at the moment.

http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses002.htm#sthref2941

> This statement:
>
> set constraints all deferred;
>
> alters all constraints that are deferrable (whether they are immediate
> or not) to be deferred until the transaction is committed. However, if
> a check is NOT defined as deferrable, then that check is not deferred
> with the statement above, and the check can never temporarily be
> allowed to fail.
>
> The set constraints statement is reset on either commit or rollback of
> the transaction.

There are other ways of changing this as well:

http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/data_int.htm#sthref3150
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/data_int.htm#i7039
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/data_int.htm#i4011

Kind regards

        robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
Received on Mon Jun 08 2009 - 16:24:48 CDT

Original text of this message