[EMAIL PROTECTED] wrote:
Is there any reason to specify an INTEGER PRIMARY KEY field in a table, if it
is going to be used solely as an auto-increment field?  Isn't an integer
primary key which is auto-incrementing in reality exactly the same as using
ROWID?

They are the same. And you can use the interchangable, in the same table.



I guess my question is really, if I'm using rowid as my auto-incrementing unique identifier for a record, and I store the rowid of a row in a field in a different row of the table to reference the former row, am I opening myself up to any problems that would not occur if instead I used an auto-incrementing integer primary key to identify each row?


Yes. If you make referneces to ROWID but then export your database (using, for example, the ".dump" command of the sqlite shell) and reimport it, all of your ROWIDs will change and your references won't be right any more. If you use an INTEGER PRIMARY KEY, the ".dump" command will preserve the values and your references will not be broken by the export.


-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to