On May 8, 2014 4:39 AM, "phaworth" <p...@lcsql.com> wrote:
>
> I'd vote for having this as a future enhancement under the control of a
> pragma or some other way of making it optional.  Some of my tables have
more
> than 1 foreign key and without the constraint name I have to write
> application code to pre-check for foreign key errors since I can't
translate
> the error into a user friendly message.

Same problem here. When the fk violation occurs inside a large transaction,
e.g. during a bulk data import it is essential that the user is given any
possible help to be able to locate the data that violates ref integrity and
fix it. Without this, prechecking the fks is the only option. And I would
argue in favor of a compiler switch to enable instead of a pragma.

Btw, if you decide to implement it, please format the error messages in
such a way that it will be easy to extract the name of the table/constraint
with code, e.g. with a regexp. For example quote them. Another thought is
to include the name of the last savepoint at the time of the violation in
the error message if there is one. It may be helpful to locate the
offending record if the violated constraint was deferred.

--Constantine
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to