At Thu, 8 Jan 2015 13:46:37 +0000, Simon Slavin wrote: > > > On 8 Jan 2015, at 1:38pm, Niall O'Reilly <niall.orei...@ucd.ie> wrote: > > > I'ld have expected the foreign_keys pragma setting to have been > > preserved. > > That makes sense in terms of how a sensible user would expect SQLite > to behave. But unfortunately it's not what SQLite does. See > section 2 of > > <https://www.sqlite.org/foreignkeys.html> > > I think that the reason is that FOREIGN KEYs were developed a long > time after SQLite3. A choice was made that they should default to > OFF to preserve backward compatibility.
I think that was the right choice for default behaviour. What seems wrong to me is that the design doesn't provide for persistence of an explicit change to the default mode, just as in the case of the pragma which sets journal mode to WAL, or the other one which sets page size. I can't see why one would wish to have foreign key support for some connections but not for others. I expect that the work involved in having this pragma set persistent state (whether in the database header or in a special internal table) would require only modest effort and would be almost perfectly safe. I hope I may look forward to reading a reaction from the developers. Best regards, Niall O'Reilly _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users