On Dec 15, 2008, at 11:23 AM, Thomas Briggs wrote:

>   I think Nathan's point is that the integer you get when declaring a
> column INTEGER PRIMARY KEY can hold a 64-bit value anyway, so why
> couldn't it simply be declared differently and behave the same?

INTEGER PRIMARY KEY is the exception to the rules for SQLite  
datatypes.  Any other column can hold any datatype, regardless of the  
declared datatype.  But an INTEGER PRIMARY KEY is different.  INTEGER  
PRIMARY KEY is an alias for the underlying rowid.  It can only hold an  
integer.

If we allowed any integer-typed column that was a PRIMARY KEY to  
behave this way, then you would suddenly have many expections to the  
rule, rather than just one.  And there would be no way to declare a  
column that had integer affinity that was the primary key.

The INTEGER PRIMARY KEY exception was first introduced in SQLite  
version 2.2.0, about 7 years ago (2001-12-20).


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