Hello, Here's a simple script creating a table with two CHECK constraints:
*create table* x ( a int *check *(a > 0), b int, *constraint *x_c *check *(a > b) ); The first check constraint is "scoped" to a single column, whereas the second one is "scoped" to the whole table. When trying to discover the above constraints, I'm surprised that only the second one is returned from this query: *select *constraint_name, table_name, check_expression *from *information_schema.constraints *where *table_name = 'X'; The first one seems to be available only from this query *select *table_name, check_constraint *from *information_schema.columns *where *table_name = 'X' *and *check_constraint != ''; Is this the intended behaviour? In my opinion, both constraints should appear in the constraints view, though. Note, this is how I would query for CHECK constraints in the SQL standard INFORMATION_SCHEMA (e.g. in Postgres, or HSQLDB): *select * tc.table_schema, tc.table_name, cc.check_clause *from * information_schema.table_constraints tc *join* information_schema.check_constraints cc *using *(constraint_catalog, constraint_schema, constraint_name); Cheers Lukas -- 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?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
