You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by Tomohito Nakayama <to...@basil.ocn.ne.jp> on 2007/10/09 16:12:24 UTC

Questionable part in reference manual of CONSTRAINT clause

Hello.
I'm not sure about CONSTRAINT so much, then this may be just my
misunderstanding ...

Reading page of Reference manual for CONSTRAINT clause, I found
questionable part in "Referential actions".
http://db.apache.org/derby/docs/dev/ref/rrefsqlj13590.html

Questionable part is as next.

==============
The update rule applies when a row of either the parent or dependent
table is updated. The choices are NO ACTION and RESTRICT.

<snip>

If the update rule is NO ACTION, Derby checks the dependent tables for
foreign key constraints /after/ all deletes have been executed but
/before/ triggers have been executed. If any row in a dependent table
violates a foreign key constraint, the statement is rejected.

<snip>

The delete rule applies when a row of the parent table is deleted and
that row has dependents in the dependent table of the referential
constraint. If rows of the dependent table are deleted, the delete
operation on the parent table is said to be /propagated/ to the
dependent table. If the dependent table is also a parent table, the
action specified applies, in turn, to its dependents.
==============


What I'm not sure is next sentence in above.
==============
If the update rule is NO ACTION, Derby checks the dependent tables for
foreign key constraints */after/ all deletes* have been executed but
/before/ triggers have been executed. If any row in a dependent table
violates a foreign key constraint, the statement is rejected.
==============

I'm not sure why is "after all deletes" for "update".
I think this may be mistake ....

Best regards.

-- 
/*

        Tomohito Nakayama
        tomonaka@basil.ocn.ne.jp
        tomohito@rose.zero.ad.jp
        tmnk@apache.org

        Naka
        http://www5.ocn.ne.jp/~tomohito/TopPage.html

*/ 



Re: Questionable part in reference manual of CONSTRAINT clause

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Tomohito Nakayama <to...@basil.ocn.ne.jp> writes:

> What I'm not sure is next sentence in above.
> ==============
> If the update rule is NO ACTION, Derby checks the dependent tables for
> foreign key constraints */after/ all deletes* have been executed but
> /before/ triggers have been executed. If any row in a dependent table
> violates a foreign key constraint, the statement is rejected.
> ==============
>
> I'm not sure why is "after all deletes" for "update".
> I think this may be mistake ....

I agree. It doesn't make sense unless it reads "after all updates have
been executed".

Dag