Petite Abeille <[email protected]> wrote:
> For example, one can define a named unique key constraint:
> 
>     constraint  header_uk unique( name ),
> 
> This will result in SQLite automagically creating an unique index to support 
> the constraint. What's the name of that index? No
> one knows for sure, as it's automatically generated (e.g. 
> sqlite_autoindex_header_1 or something) instead of simply using the
> provided name of the constraint.  

It is legal to have a named constraint, and an unrelated index with the same 
name. There may be databases like this out there. With the proposed change, 
those databases would stop working.

> This might not have mattered much in the past as one couldn't refer to 
> indexes by name.
> 
> But now  SQLite provides the INDEXED BY phrase [1]. Where one can refer to 
> indexes by name.

If you want to refer to an index by name, I suggest you explicitly create this 
index with the name of your choosing.

> SQLite took it upon itself to randomly generate a totally unrelated name. 

Also known as "SQLite took care to avoid name collisions".
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to