db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6527) Fix errors in foreign keys documentation
Date Mon, 12 May 2014 12:20:20 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13995032#comment-13995032

Dag H. Wanvik commented on DERBY-6527:

> Thanks, Dag. So I guess I should remove "or NO ACTION" from the two sentences. Would
that be enough, since > we are clarifying the BEFORE trigger situation?

Yes, just remove the NO ACTION. But add: for NO ACTION, the statement is usually also true,
*except* if a trigger would remove the dependent row somehow.

As for the default action, what I meant is as follows: If no "ON DELETE" clause is used, the
default action upon a delete of the row containing a referenced key is NO ACTION. If no "ON
UPDATE" clause is specified, the default action upon a modification of the referenced key

If a delete of a child (referenced) row is *deleted*, there is (trivially) no problem, since
there is no longer a referring row. 

If the foreign key of a child row is *modified*, the default action is always NO ACTION, i.e.
we do not check of the FK holds until *after* any before triggers have been executed.  Unfortunately,
in Derby we do not yet allow inserts or update in before triggers, so in practice the statement
is also true for NO ACTION... So, I was wrong with regards to the current Derby implementation,
but correct as to the fact there *could* be a difference in behavior had we implemented the
full standard..

> Fix errors in foreign keys documentation
> ----------------------------------------
>                 Key: DERBY-6527
>                 URL: https://issues.apache.org/jira/browse/DERBY-6527
>             Project: Derby
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions:
>            Reporter: Dag H. Wanvik
>            Assignee: Kim Haase
>         Attachments: DERBY-6527-2.diff, DERBY-6527.diff, rrefsqlj13590.html, rrefsqlj13590.html
> Cf this email thread: http://apache-database.10148.n7.nabble.com/Foreign-key-semantics-as-documented-td138227.html
> Our documentation in the reference manual on foreign keys/referential actions has errors.

This message was sent by Atlassian JIRA

View raw message