SQLite Forum

CHECK violation during table definition ignored, normal or bug?
Login
And this syntactic sugar is what can help assign a name to that constraint, not the column name(s) involved in whatever expression follows but that of the column where the `CHECK` appears.

So, in your specific example, I would expect a failure on `b integer check (c > 4)` to show `Error: CHECK constraint failed: t(b)`

even if it was the value in `c` that caused it.

Because now I can go to my table definition and look at column `b` (the one shown in the error) and see there is a check there which refers to column `c` (and possibly others).  But, at least now I have a place to start my search rather than look all over the table to see which of a myriad of checks may have failed.