Weissmann Markus <[EMAIL PROTECTED]> wrote:
> 
> oh, well - thanks for this hint! Nevertheless sqlite 3.3.1 (still)  
> does not complain:
> 
> SQLite version 3.1.3
> sqlite> create table t (a integer primary key, b integer, check(b > 0));
> sqlite> insert into t(b) values(-19);
> sqlite> select * from t;
> 1|-19
> 

You example is from version 3.1.3, not 3.3.1.  Version 3.1.3
does not enforce check constraints.  Version 3.3.1 does.
Here is a screen scrap from where I just tried your test:

   SQLite version 3.3.1
   Enter ".help" for instructions
   sqlite> create table t (a integer primary key, b integer, check(b>0));
   sqlite> insert into t(b) values(-19);
   SQL error: constraint failed
   sqlite> select * from t;
   sqlite> 

--
D. Richard Hipp <[EMAIL PROTECTED]>

Reply via email to