> (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.


Pavel


On Thu, Mar 1, 2012 at 8:40 AM, Petite Abeille <petite.abei...@gmail.com> wrote:
>
> On Mar 1, 2012, at 2:27 PM, Igor Tandetnik wrote:
>
>> If you want to refer to an index by name, I suggest you explicitly create 
>> this index with the name of your choosing.
>
> I would if I could. Unfortunately, in SQLite, in the case of unique 
> constraints, this cannot be done as far as I know. Or?
>
> (1) If one declares an unique constraint, SQLite will automaticaly create a 
> randomely named index.
>
> (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 …).
>
> So, either one can have a named constraint in the initial DDL, but a randomly 
> named index. Or no constraint at all, and a named index.
>
> Looks half-backed to me.
>
> To add insult to injury, none of the constraint names are available anywhere 
> anyway anyhow. Sigh...
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to