D. Richard Hipp wrote:
> On Sep 6, 2008, at 2:50 AM, Scott Hess wrote:
>
>   
>> On Fri, Sep 5, 2008 at 11:31 PM, jonwood <[EMAIL PROTECTED]>  
>> wrote:
>>     
>>> .... But the documentation states the ROWID
>>> can change at any time so I'm not sure what I can do safely.
>>>       
>> Do this:
>>
>> CREATE TABLE t (
>>  id INTEGER PRIMARY KEY,
>>  a TEXT NOT NULL,
>>  b INTEGER NOT NULL,
>>  UNIQUE (a, b)
>> );
>>
>> (a,b) will be just as unique as in the first case, but now you can use
>> id as a stable alias for rowid....
>>     
>
> I promise that INTEGER PRIMARY KEY will always be an alias for the  
> rowid in SQLite.  This will not change.
>   
I am not sure what all this means when taken together.

It sounds as if defining  id  as shown above is unnecessary, since it is 
just an alias for ROWID, and if one is stable the other has to be. Correct?

So now I can't interpret  "ROWID can change" as meaning anything other 
than "the ROWID supplied by SQLite while doing an insertion, if none is 
supplied by the user, can change at any time." Is this correct?

My little Tcl/Tk routines for displaying and managing SQLite files have 
always assumed ROWID is a safe stable way of determining a row. Have I 
missed something? (again?)

Thanks,

Gerry

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

Reply via email to