On Sun, Nov 23, 2014 at 8:40 PM, Jussi Piitulainen <jpiit...@ling.helsinki.fi> wrote: > Chris Angelico writes: >> On Sun, Nov 23, 2014 at 7:21 PM, Frank Millman wrote: >> >> > To enable them, add the following - >> > >> > pragma foreign_keys = on; >> > >> > It works for me. >> >> Thanks, I went poking around briefly but didn't find that pragma. > > I didn't notice a pointer to the relevant documentation in this thread > yet. So here, and in the rest of that page: > > <http://www.sqlite.org/foreignkeys.html#fk_enable>
>From that page: """Foreign key constraints are disabled by default (for backwards compatibility), so must be enabled separately for each database connection. (Note, however, that future releases of SQLite might change so that foreign key constraints enabled by default. Careful developers will not make any assumptions about whether or not foreign keys are enabled by default but will instead enable or disable them as necessary.)""" That explains it. Putting the "backwards" into "backwards compatibility", but understandable, at least. I'm pointing all the people I know to this page; just enable the things and then you can actually trust stuff. ChrisA -- https://mail.python.org/mailman/listinfo/python-list