Subject | Re: [firebird-support] Re: From Restriced to CASCADE on delete |
---|---|
Author | Nando Dessena |
Post date | 2008-01-16T21:36:58Z |
Helen,
H> I have no idea what Nando had in mind by "subtle differences".
Not that it matters for Firebird (I think), but NO ACTION means allow
updates to FK columns as long as the new values are still correct
(that is, they reference an existing row in the referenced table);
RESTRICT means disallow updating FK columns altogether. IOW, you can
reparent a row with NO ACTION, while you can't with RESTRICT. This is
about updates; I guess they are the same as far as the delete action
goes. I cannot say where I got the above information from, it was
quite a while ago and I don't have any SQL standard docs at hand now.
BTW I have now performed a test: Firebird treats both as if they were
NO ACTION.
H> Even Oracle and DB2 seem to have no implementation difference
H> between RESTRICT and NO ACTION.
Here is a quote from the DB2 docs:
"A delete or update rule of RESTRICT is enforced before all other
constraints including those referential constraints with modifying
rules such as CASCADE or SET NULL. A delete or update rule of NO
ACTION is enforced after other referential constraints. There are very
few cases where this can make a difference during a delete or update."
Talk about subtle! :-) I am not sure about Oracle.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================
H> I have no idea what Nando had in mind by "subtle differences".
Not that it matters for Firebird (I think), but NO ACTION means allow
updates to FK columns as long as the new values are still correct
(that is, they reference an existing row in the referenced table);
RESTRICT means disallow updating FK columns altogether. IOW, you can
reparent a row with NO ACTION, while you can't with RESTRICT. This is
about updates; I guess they are the same as far as the delete action
goes. I cannot say where I got the above information from, it was
quite a while ago and I don't have any SQL standard docs at hand now.
BTW I have now performed a test: Firebird treats both as if they were
NO ACTION.
H> Even Oracle and DB2 seem to have no implementation difference
H> between RESTRICT and NO ACTION.
Here is a quote from the DB2 docs:
"A delete or update rule of RESTRICT is enforced before all other
constraints including those referential constraints with modifying
rules such as CASCADE or SET NULL. A delete or update rule of NO
ACTION is enforced after other referential constraints. There are very
few cases where this can make a difference during a delete or update."
Talk about subtle! :-) I am not sure about Oracle.
Ciao
--
Nando Dessena
======================================================
I support Firebird, I am a Firebird Foundation member!
Join today at http://www.firebirdsql.org/ff/foundation
======================================================