But it seems this does not work. All I get is
General error: "java.lang.NullPointerException"

I will make it throw a better exception message. Unfortunately it's
not possible to define foreign keys on information_schema tables (also
you can't define triggers yet). There is a feature request for
triggers on information_schema tables, but it's relatively hard to
implement.

It would be a greatly beneficial feature if one could define a foreign key
to INFORMATION_SCHEMA tables.

I already mentioned this but I think it is so important that I can slightly repeat myself.

When extending h2 in a user space using the sql and interfaces that h2 already provides I think it would be most effective way to integrate user defined structures to structures defined in h2.

Let's say you want to give every table some additional data.
In my case it was synchronization rules to emulate materialized views.
Whenever the table is dropped then the foreign key would automatically
take care of the user defined related data.

No procedural code needed!


To delete old data when opening the database, you could do is create a
trigger on a dummy table (or on the table above) and delete the old
data when the trigger object is created.

Currently I remove trigger related data in trigger's remove method.
If you start a new thread for the connection it works fine.

Would be great to have similar hooks for whenever a table is dropped too.
But currently my method is using function to create and drop a materialized view ( = a tables and a set of triggers) CALL CREATE_MV(..), CALL DROP_MV(..) and the latter one takes care of the cleanup.

are ON DELETE CASCADE
and ON UPDATE CASCADE
defaults if I don't mention them?

No. I will document that.

So what is the default then
- RESTRICT
- NO ACTION
- SET DEFAULT or
- SET NULL

- rami

--
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