SQLite Forum

CHECK violation during table definition ignored, normal or bug?
Login
It does, if and only if you ask it too.

```
create table t
(
   a integer, 
   b text default 'abc' constraint b_too_long check (length(b)<3)
);
insert into t (a) values (1);

yields:

sqlite> create table t
   ...> (
   ...>    a integer,
   ...>    b text default 'abc' constraint b_too_long check (length(b)<3)
   ...> );
sqlite> insert into t (a) values (1);
Error: CHECK constraint failed: b_too_long
sqlite>
```

Note that it is a bad tradesman who blames their tools when they use those tools improperly.