Re: [sqlite] foreign key constraint failure

2017-05-10 Thread Mark Wagner
Thanks for the clever ideas. In my case I figured it out by hand (it was a trigger which was inserting a row with a foreign key into another table that no longer existed). But I will make use of those strategies in the future. On Tue, May 9, 2017 at 11:54 PM, Gwendal Roué

Re: [sqlite] foreign key constraint failure

2017-05-10 Thread Gwendal Roué
There is a way, but it requires some effort: First let's define a schema that reproduces your error: CREATE TABLE t1 ( id INTEGER PRIMARY KEY); CREATE TABLE t2 ( id INTEGER PRIMARY KEY, id1 INTEGER REFERENCES t1(id) ON DELETE RESTRICT); INSERT INTO t1 (id) VALUES

Re: [sqlite] foreign key constraint failure

2017-05-10 Thread nomad
On Wed May 10, 2017 at 08:34:42AM +0200, Clemens Ladisch wrote: > Mark Wagner wrote: > > Is there a way to get sqlite to tell which foreign key constraint is > > causing a failure? > > No; to make the implementation of deferred constraints easier, it keeps > track only of the number of remaining

Re: [sqlite] foreign key constraint failure

2017-05-10 Thread Clemens Ladisch
Mark Wagner wrote: > Is there a way to get sqlite to tell which foreign key constraint is > causing a failure? No; to make the implementation of deferred constraints easier, it keeps track only of the number of remaining foreign key failures, not of their origin. Regards, Clemens

[sqlite] foreign key constraint failure

2017-05-09 Thread Mark Wagner
Is there a way to get sqlite to tell which foreign key constraint is causing a failure? Some kind of verbose mode? Thanks! sqlite> delete from t; Error: FOREIGN KEY constraint failed sqlite> ___ sqlite-users mailing list