SQLite Forum

CHECK violation during table definition ignored, normal or bug?
Login
It does not give the name of the column, but the name you assign to the constraint. So, it's not quite the same.

Giving the name to similar constraints is useful.  You can (and in many cases you'd want to) give the exact same name, such as 'not_yyyy_mm_dd' so that you know the type of violation.  Doing the same and pre/ap-pending the name of column just to know which column gave the error is rather inadequate, and prone to misinformation, if you happen to rename the column but forget to also update the constraint name.

I still think the error would be much more useful if it returned the column name affected.  For me, returning just the table name is rather redundant as an `INSERT` or `UPDATE` can only work on a single table, so there is no ambiguity.
Maybe the error could be like: t(col) to show both affected table and column.

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

As for this comment, it's fortunate there are enough 'bad tradesmen' around or your presence here would be a bit redundant with no-one to help!