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

Thanks Tom,

It actually makes sense to never drop any automatic index (!). My question
should have been how to reliably determine whether an index is automatic or
not. Unless someone can come up with a compelling reason not to test for
"sqlite_autoindex_" in pragma index_list, I'd prefer to stick to that.

Now I'm wondering if in future a situation could arise where the SQL will be
provided for automatic indexes... Eg. to aid in exporting DDL.


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

A simple "autoindex" field in pragma index_list would be a good start :-)


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

Reply via email to