On Mar 7, 2013, at 6:21 AM, Nico Williams <n...@cryptonector.com> wrote:

> In conclusion, if you want to allow affine type conversions on INSERT,
> but not disallow values that cannot be so converted, then
> CHECK(my_column = CAST(my_column AS <TYPE>)) works.  And if you want
> to disallow values of incorrect types even when type conversion is
> possible then use CHECK(typeof(my_column = <TYPE>).  That's pretty
> cool, IMO.

Yeah… 'cool' is not necessarily how I would describe it… having a check 
constraint 'magically' coerce - change! - the inserted data type is… well… not 
cool. I would call it a misfeature :)

Yet another SQLite gotcha to watch out… sigh... 

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

Reply via email to