Menu

#12 Crash when using unique indexes on expressions

Main_team
closed
nobody
None
3
2016-09-07
2016-08-19
No

Crashes when trying to use a unique index on an expression rather than on a single column.

This works:

create unique index vehicle_unique on vehicle (registration);

This doesn't work:

create unique index vehicle_unique on vehicle (lcase(registration));

Probably, the solution is not to generated the "select by UI" methods for the second case. It doesn't make sense. Does it?

The java exception says:

Key column 'K00' not found on table 'VEHICLE'.

SquirrelSQL shows "K00" as a pseudo column for the expression lcase(registration) in the JDBC metadata reported for the unique index.

Discussion

  • Vladimir Alarcon

    • status: open --> closed
     
  • Vladimir Alarcon

    Fix: the simple solution was to ignore unique indexes on expressions. They can never be the target of a FK.

    Unique indexes on columns are kept since they are suitable as the target of an FK.

     

Log in to post a comment.

MongoDB Logo MongoDB