Hello,
In the extremely unlikely event of someone using a comma in their column
names AND using that column in a constraint, then
the INFORMATION_SCHEMA.CONSTRAINTS.COLUMN_LIST column will yield wrong
values. Example:
create table test1 ("A,B" int, A int, B int, primary key ("A,B"));
create table test2 ("A,B" int, A int, B int, primary key (A, B));
select table_name, column_list from information_schema.constraints where
lower(table_name) like 'test%';
+----------+-----------+
|TABLE_NAME|COLUMN_LIST|
+----------+-----------+
|TEST2 |A,B |
|TEST1 |A,B |
+----------+-----------+
A workaround would be to specify COLUMN_LIST to conform to CSV format.
The optimal solution would of course be to correctly normalise this view
and deprecate COLUMN_LIST. The latest draft version that is freely
available from the SQL:2011 standard (http://www.wiscorp.com/sql20nn.zip)
defines the following relations in the INFORMATION_SCHEMA:
- TABLE_CONSTRAINTS
- KEY_COLUMN_USAGE
- CONSTRAINT_COLUMN_USAGE
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.
For more options, visit https://groups.google.com/groups/opt_out.