On 18/03/2011, at 8:58 PM, Paul van Helden wrote:

> Another solution that ocurred to me is to check for "sqlite_autoindex_" in
> the name field of pragma index_list(tablename). Can I simply assume that
> unique indexes named sqlite_autoindex_* cannot be dropped?

Automatic indexes have no "SQL" entry in the SQLite_Master table, so you can 
use that to see if you can drop it. eg:

select Name from SQLite_Master where type = 'index' and SQL is null

will give you the name of all the automatic indexes, which can't be dropped.

> Perhaps if pragma table_info(tablename) had a "unique" column like it has a
> "notnull" column,

Yes, we definitely need more extensive schema introspection facilities in 
SQLite.

Thanks,
Tom
BareFeetWare

 --
Comparison of SQLite GUI tools:
http://www.barefeetware.com/sqlite/compare/?ml

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

Reply via email to