Re: [sqlite] Composite Foreign Key not enforced

2010-05-17 Thread George Somers
> Fixed. See http://www.sqlite.org/src/info/dd08e5a988 and http://www.sqlite.org/src/info/636f86095e Gee! That was super FAST! Thanks a lot! George Somers ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Composite Foreign Key not enforced

2010-05-17 Thread George Somers
s -Message d'origine- De : sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] De la part de Pavel Ivanov Envoyé : 17 mai 2010 11:35 À : General Discussion of SQLite Database Objet : Re: [sqlite] Composite Foreign Key not enforced Looks like the same suggestion as DRH

Re: [sqlite] Composite Foreign Key not enforced

2010-05-17 Thread Nicolas Williams
On Fri, May 14, 2010 at 03:01:39PM -0400, George Somers wrote: [edited for brevity] > CREATE TABLE parent(parentID INTEGER PRIMARY KEY, ...); > > CREATE TABLE child(childID INTEGER PRIMARY KEY, fatherID INTEGER, ...); > > CREATE TABLE fatherChildActivity( >fcChildID INTEGER, >

Re: [sqlite] Composite Foreign Key not enforced

2010-05-17 Thread Richard Hipp
On Mon, May 17, 2010 at 11:34 AM, Pavel Ivanov wrote: > > But I can agree that SQLite shouldn't be confused by confusing > database schemas and enforce foreign keys correctly in all cases. > > Fixed. See http://www.sqlite.org/src/info/dd08e5a988 and

Re: [sqlite] Composite Foreign Key not enforced

2010-05-17 Thread Pavel Ivanov
Looks like the same suggestion as DRH already provided applies here: your indexes on (childID, fatherID) and (childID, motherID) are useless. You already have unique childID, adding fatherID or matherID to it doesn't change things. Also any other table can reference only childID, there's no need

Re: [sqlite] Composite Foreign Key not enforced

2010-05-14 Thread George Somers
Thanks for your quick answer! I was trying to provide a simple example. Here is another example to demonstrate the problem. I am using a lot "surrogate key with propagation", and this is why I have many composite foreign keys. PRAGMA foreign_keys = ON; CREATE TABLE parent( parentID

Re: [sqlite] Composite Foreign Key not enforced

2010-05-14 Thread Richard Hipp
On Thu, May 13, 2010 at 5:50 PM, George Somers wrote: > Hello, > > It seems that composite FK are not enforced on SQLite 3.6.23.1. > The following script shows that the DELETE FROM table "artist" will work, > even though > there is a composite FK from table "track" toward

[sqlite] Composite Foreign Key not enforced

2010-05-13 Thread George Somers
Hello, It seems that composite FK are not enforced on SQLite 3.6.23.1. The following script shows that the DELETE FROM table "artist" will work, even though there is a composite FK from table "track" toward table "artist". PRAGMA foreign_keys = ON; CREATE TABLE artist( artistidINTEGER