Thanks for all the responses - I seem to have opened up a can of worms!

Looking into his further, I see differences in how constraint failures are
reported.  In the case of a NOT NULL constraint, I got an error
"<table>.<column> may not be NULL".  In the case of a UNIQUE constraint,
the error was "column <column> is not unique".  But if a CHECK constraint
failed, the error was simply "constraint failed" with no reference to the
column name or that it was a CHECK constraint that failed.

I could probably deal with any error message that included the column name
in terms of reinterpreting it for display to a user, just as I would if the
constraint name was reported, but the bare bones "constraint failed" error
is hard to deal with.  Maybe I will use a trigger with "RAISE()" instead of
check constraint.

It also seems that only one error is reported even if multiple constraint
violations occur.  Maybe that would change depending on the ON CONFLICT
action specified?

I guess all I can do is add my vote to the list of people who would like
improvements to the way constraint violations are reported, perhaps with a
PRAGMA to control the new logic.

Thanks,


-- 
Pete
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to