----- Original Message -----
From: "Dennis Cote" <[EMAIL PROTECTED]>
I think you should be safe with this scheme. SQLite prevents a user from
creating an index named sqlite_autoindex_*, so any index named that way,
and containing all the primary key columns and only the primary key
columns, must be the primary key.
The only gotcha I see is the fact that a integer primary key column
doesn't generate an autoindex at all. You will have to infer the existence
of this index this from the primary key flag on the column, and the lack
of an autoindex on that column only.
Ya I know, I already do that ... my steps are:
- Fetch the table_info for a table
- Record all rows in the table marked with pk=1 in an array
- If there is only 1 pk flagged item in the array and it is type integer,
then add a fake entry in my list of indexes and mark it a primary key index
- Enumerate index_list for above given table
- If given index is sqlite_autoindex_% and all columns in said index have pk
flag from table_info above, then add the index to the list and mark it as a
primary key index
- For all other indexes, just add them to the list
Robert