Unique constraint and resulting index name

Ari Suutari <[email protected]> Thu, 29 Sep 2016 07:55:52 +0000
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <DB6PR0301MB2200D87F5244295BAE6F5F5BF2CE0@DB6PR0301MB2200.eurprd03.prod.outlook.com>
Hi,

Consider a table created with statement like this:
create table test(a varchar(80), b varchar(80), constraint test_uk unique(a,b))

This results in table having index with name "SYS_IDX_TEST_UK_10124". This is
just fine for SQL usage of the table, usually no-one is interested in the index name.

However, we have a system which does all database schema management automatically via JDBC.
When scanning the table for indexes, the JDBC API returns the name starting with "SYS_IDX...", which
kind of confuses the system because it expects "TEST_UK" to be returned.

All "bigger" databases we are using (postgresql, sql server, oracle) have an index which has matching
name to unique constraint.

I wonder if HSQLDB could be made to work this way also ? Or is the only solution to
create special logic into application for this ?

   Ari S.

------------------------------------------------------------------------------

_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user