On Mar 1, 2012, at 2:51 PM, Pavel Ivanov wrote:

>> (2) If one create an unique, named index, one cannot use an unique 
>> constraint as there is no way to add constraints after the table creation 
>> (i.e. no alter add constraint …).
> 
> You don't need to create a unique constraint when you created a unique
> index. Unique index implies that you can't insert duplicate records.

Precisely. In fact they are mutually exclusive. 

Nonetheless, the constraint declares an intent. An index provide an enforcement 
mechanism. Therefore if one declares an unique constraint, one gets an unique 
index to enforce it. I just wish I could name that index in a meaningful way so 
I don't have to choose between declaring a constraint and having a random index 
or having a meaningfully named index but no constraint declaration.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to