Subject FKs: distinction between RESTRICT and NO ACTION
Author Milan Babuskov
Hello all,

I came across and interesting issue. First version, I create foreign key like this:

alter table TABLE2 add constraint FK_TABLE2_1
foreign key ( x ) references TABLE1 ( x )
on update NO ACTION;

Second version:

alter table TABLE2 add constraint FK_TABLE2_1
foreign key ( x ) references TABLE1 ( x );

The effect seems to be the same. However, when I query the system tables there
is a difference:

select r.rdb$constraint_name, c.rdb$update_rule
from rdb$relation_constraints r, rdb$ref_constraints c
where r.rdb$relation_name = 'TABLE2'
and r.rdb$constraint_name = c.rdb$constraint_name
and (r.rdb$constraint_type='FOREIGN KEY')

In first case, for RDB$UPDATE_RULE column the value stored is 'NO ACTION' and in
second case it's 'RESTRICT'.

Is RESTRICT equal to NO ACTION? Why do they exist?

BTW, is the devel list more appropriate for this kind of questions?

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org