Yes. Look at the CREATE TABLE for table A (completely ignore table B as it serves no purpose whatsoever)....
If you change the database to write to a database on disk so you can examine it after (or modify doSql so that it outputs the SQL so that you can read it) everything will become much clearer ... Also, if you create an index on the child key as is required for performance, there is no "slowdown" whatsoever.... ie after this line: doSql(db, "create table a (id int PRIMARY KEY, name text, aid int not null, FOREIGN KEY(aid) REFERENCES a(id))"); insert this line" doSql(db, "create index aid on a (aid)"); --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-----Original Message----- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of Dominique Devienne >Sent: Thursday, 2 August, 2018 01:48 >To: General Discussion of SQLite Database >Subject: Re: [sqlite] Violated failed foreign key constraint delays >the rest of transaction ; Some foreign key violations don't trigger >the error at all > >On Thu, Aug 2, 2018 at 9:35 AM Keith Medcalf <kmedc...@dessus.com> >wrote: > >> You observe no violation when VIOLATION is 0 because there is no >> referential integrity violation to report ... >> > >Really Keith? Parent IDs are in range [0, NROWS) >Child/FK IDs inserted are in range [NROWS, 2*NROWS) >How's that not an FK violation? At least that's how I read the code. >Am I >reading wrong? --DD >_______________________________________________ >sqlite-users mailing list >sqlite-users@mailinglists.sqlite.org >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users