On Tue, May 6, 2014 at 5:12 PM, Peter Haworth <p...@lcsql.com> wrote:
> It seems that foreign key errors on columns where the foreign key > definition has a constraint name don't include the constraint name in the > error message. This is using sqlite version 3.8.3.1. > > Is this under the control of a compile switch or PRAGMA or am I stuck with > the way it is? > SQLite does not keep track of which foreign key constraints fail. It simply keeps a counter which is incremented whenever a foreign key constraint fails and decremented whenever the foreign key constraint is resolved. If that counter is positive at the conclusion of a statement, that means one or more foreign key constraints failed, but it provides no information about which constraint. (Actually, there are two counters, one for immediate constraints and another for deferred constraints.) It is theoretically possible to keep track of which constraints are failing so that the particular constraint can be identified in the error message. But that woudl require more memory and CPU cycles. > > Pete > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users