create table foo (id bigint identity);
create table bar (id bigint identity, foo_id bigint references foo on
delete cascade);
create table baz (id bigint identity, foo_id bigint references foo on
delete cascade, bar_id bigint references bar);

insert into foo (id) values (1);
insert into bar (id, foo_id) values (1, 1);
insert into baz (id, foo_id, bar_id) values (1, 1, 1);

delete from foo where id = 1;

The delete is cascaded to bar, but that record can't be deleted
because it's referenced from baz. Compare this to PostgreSQL, which
realizes that the delete also cascades to the record in baz, and will
go ahead and delete the three records from foo, bar and baz.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to