On Thu, Mar 1, 2012 at 9:01 AM, Petite Abeille <[email protected]> wrote: > 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.
I don't understand why you need to have constraint declaration. Do you have some kind of parser of table definition and your application relies on it to find all constraints that SQLite enforces? Pavel _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

