db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Creating multiple indexes with different names on the same column does nothing.
Date Sun, 02 Nov 2008 12:32:10 GMT
David Van Couvering <david@vancouvering.com> writes:

> I noticed that if you try to create two indexes with different names on the
> same column set that Derby silently ignores the command.
>
> I can understand the rationale - it doesn't make sense to maintain two keys
> against the same columns - they're the same key.  But it would be useful to
> say something that lets the user know that the index already exists, rather
> than silently succeeding.

Hi David,

We do raise a warning in these cases, so it's not quite silent, but I
don't think many applications actually check the warnings. IJ does,
though:

ij> create table t (x int);
0 rows inserted/updated/deleted
ij> create index i1 on t(x);
0 rows inserted/updated/deleted
ij> create index i2 on t(x);
0 rows inserted/updated/deleted
WARNING 01504: The new index is a duplicate of an existing index: I1.

-- 
Knut Anders

Mime
View raw message