Unique constraint and resulting index name

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Unique constraint and resulting index name

Ari Suutari

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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user
Loading...