Hello. Database indexes are not a part of the SQL standard. They are database-specific.
PRIMARY KEY (…) is not an index, it's a constraint. Constrains and their behavior are described in the standard, but their actual implementations can be different. When you use getPrimaryKeys() H2 returns a name of the constraint, if any, in PK_NAME. Such behavior is expected, but Javadoc of H2 should be improved. When you use getIndexInfo() you get names of indexes. You should not expect to find a name of a constraint here in portable applications, but some databases work in such way. In H2 you get the name of an hidden index that is created by PK constraint. The simplest way here is to ignore such indexes with autogenerated names. -- 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 https://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
