On Oct 22, 2009, at 7:11 PM, Igor Tandetnik wrote:
>
> In SQLite, ROWID _is_ the unique identifier for each record. Any  
> field declared INTEGER PRIMARY KEY is simply an alias for ROWID.  
> "Position in the set", whatever it is, has nothing to do with it.

A clarification:

The ROWID is always unique, but it not guaranteed to be static.   
ROWIDs can and often does change when you VACUUM.  Except, if you  
declare an INTEGER PRIMARY KEY, then the IPK will be the same as the  
rowid and the IPK will not change because of VACUUM.  Moral:  Always  
use INTEGER PRIMARY KEY, never a raw ROWID, for anything that you want  
to persist for longer than the current transaction.

D. Richard Hipp
d...@hwaci.com



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

Reply via email to