On Fri, Oct 14, 2011 at 02:17:20AM +0700, Dan Kennedy wrote: > On 10/14/2011 01:29 AM, fe...@crowfix.com wrote: > > I'm working on a project which generates tables from a config file, > > and it seems to be happy on a Mac OSX running 3.4.0, but Linux running > > 3.7.8 complains about an insert with the unhelpful message > > > > (foreign key mismatch) > > It means there is a problem with a foreign key definition in the > database schema. Either an FK specifies parent columns that do not > exist, or parent columns that are not a PRIMARY KEY or UNIQUE.
It works on MacOSX with sqlite 3.4.0, and the exact same code fails under Linux with sqlite 3.7.8, but if I use sqlite to repeat the same failing SQL statement, it works fine under Linux. But I repeat myself. > > I've checked all the data and don't see what it is complaining about, > > and if I dump the SQL to a file and execute the same commands that > > way, it works, and so does adding the single record in question using > > sqlite3. > > Error message only shows up if foreign keys are enabled ("PRAGMA > foreign_keys = ON"). They are disabled by default. Sorry to be grumpy, but what does this have to do with the price of red grapefruit on Mars Colony Three? If I get the error message, by your own statement that must mean the pragma enabled foreign keys. What I want to know is if there is any way to get more better reporting, such as the column or constraint it is upset about. The message is not helpful. I have checked all the columns, all the values, and they are set up properly. If there is no such more better reporting, ok, I will take other approaches. If you don't know the answer, you could either say so or say something useful or say nothing. -- ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._. Felix Finch: scarecrow repairman & rocket surgeon / fe...@crowfix.com GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933 I've found a solution to Fermat's Last Theorem but I see I've run out of room o _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users