On 04/07/2014 2:35 AM, Noel Grandin wrote:


On 2014-07-04 05:49 AM, Gili wrote:

Can you please elaborate? What does it mean for a constraint to reference a table with a higher id? And what do you mean by "in future versions [..] creating references to other tables with no longer be supported"? I assume you're not
talking about removing foreign keys? :)

No, this is about constraints referencing tables that are only created later.
So table1 has a check constraint which references table2.
But table2 is created after table1.
Which causes problems during our metadata initialisation at database startup.


How is this even possible? When I try creating foreign keys to tables that are only created later,the CREATE TABLE statement fails ("table X does not exist"). Can you provide an example of problematic code?

Also, here is what the changelog actually says: "There was a way to prevent a database from being re-opened, by creating a column constraint that references a table with a *higher id.* This is now detected, and creating the table is prohibited. In future versions of H2, most likely *creating references to other tables will no longer be supported* because of such problems."

Consider clarifying the bolded text. Specifically:

 * It's not clear what a "table with a higher id" means. If you mean
   tables that are created later, write that.
 * It's not clear that "creating references to other tables will no
   longer be supported" means limiting forward references exclusively.
   The sentence sounds as if you plan to remove *all* references.

Thanks,
Gili

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to