On Apr 28, 2011, at 12:41 PM, Pavel Ivanov wrote:

>> After more poking, it appears that rowids might not be changed by a vacuum 
>> if I have an index on the table. Is this true? If so, is it something I can 
>> rely on going forward?
> 
> No, it's not true. The only way to keep your rowids intact is to declare an 
> INTEGER PRIMARY KEY alias for it. And you better never reference "rowid" name 
> in your application or your database schema.

Can you explain this in more detail? I've never seen any prohibition on using 
"rowid" in the SQLite docs before. The page on autoincrement says

"You can access the ROWID of an SQLite table using one the special column names 
ROWID, _ROWID_, or OID. Except if you declare an ordinary table column to use 
one of those special names, then the use of that name will refer to the 
declared column not to the internal ROWID."

which suggests that referring to rowids is fine. If I add a "rowid integer 
primary key" column on my tables, it seems like everything would work the way I 
want it to with minimal code changes. Any reason that won't work?

-D

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

Reply via email to