Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81354

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'yet.': 0.04; 'subject:Python': 0.06; 'default.': 0.09; 'separately': 0.09; 'subject:2.7': 0.09; 'cc:addr:python-list': 0.11; 'thread': 0.14; '(note,': 0.16; '23,': 0.16; '8:40': 0.16; 'assumptions': 0.16; 'backwards': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'least.': 0.16; 'sqlite': 0.16; 'stuff.': 0.16; 'url:sqlite': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'putting': 0.22; 'cc:addr:python.org': 0.22; 'pointer': 0.24; 'cc:2**0': 0.24; 'developers': 0.25; '(for': 0.26; 'header:In-Reply-To:1': 0.27; 'rest': 0.29; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'went': 0.31; 'disable': 0.31; 'disabled': 0.31; 'enabled': 0.31; 'keys': 0.31; 'writes:': 0.31; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'explains': 0.36; "didn't": 0.36; 'url:org': 0.36; 'nov': 0.38; 'pm,': 0.38; 'skip:u 10': 0.60; 'future': 0.60; 'skip:n 10': 0.64; 'frank': 0.68; 'default': 0.69; 'foreign': 0.74; 'connection.': 0.74; 'careful': 0.91; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=FYU1OpducLE4x3xBuwTxgaS4+ApkntPBqxW6f9jbq/o=; b=0MNC3gfQJ3w3uwu+McBXNxvQw+JCGuO9PZ1Gk+r1r8CNzWdZBh+Bgyxo0kzzoGB33E Lgz5NNyUqRYiMQeABZT0Nmy5dExwWGl4nNn6WT8Ir3fETESFkI7rryWBG6rmLXJxzL8T rrHitOyXZC1gyg0S2onuyx4p2yx6FQBy2wq+0GV41cI3921Mz3voSVt9+57fkXtxD8V+ /PKfBGYQxMm4puavVpuAIwd30j/TE53WTcyVOuQNgFqolyTBNJu/Rc1IEnGbLFcq1b8P 55xXhe5LLL0tNmOgT3fugHzga6GtS2bX5na1poGZUd3QU3bbvSQxlpl6hg1tdgXdoYdP QeDg==
MIME-Version 1.0
X-Received by 10.42.106.12 with SMTP id x12mr20080735ico.26.1416736396686; Sun, 23 Nov 2014 01:53:16 -0800 (PST)
In-Reply-To <qotmw7iqmom.fsf@ruuvi.it.helsinki.fi>
References <ca987fb8-157d-4612-bafa-5da2da2920e0@googlegroups.com> <mailman.16153.1416709340.18130.python-list@python.org> <5d474a87-e2a5-43d3-b07c-4a1194880b4d@googlegroups.com> <54716987.7040301@gmail.com> <mailman.16159.1416721303.18130.python-list@python.org> <ea4e3af8-f173-4706-ba4e-4eca9d701e40@googlegroups.com> <CAPTjJmp4Y5zowWn5yFtJutKO4H5jVtqLaNtWqEpA6B35xNdsNA@mail.gmail.com> <m4s5er$sg1$1@ger.gmane.org> <mailman.16169.1416731513.18130.python-list@python.org> <qotmw7iqmom.fsf@ruuvi.it.helsinki.fi>
Date Sun, 23 Nov 2014 20:53:16 +1100
Subject Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16177.1416736404.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1416736404 news.xs4all.nl 2837 [2001:888:2000:d::a6]:43349
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:81354

Show key headers only | View raw


On Sun, Nov 23, 2014 at 8:40 PM, Jussi Piitulainen
<jpiitula@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

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-22 18:11 -0800
  Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-23 13:22 +1100
    Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-22 19:54 -0800
      Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Michael Torrie <torriem@gmail.com> - 2014-11-22 21:58 -0700
      Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-23 16:41 +1100
        Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-22 22:08 -0800
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-23 17:32 +1100
            Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-22 22:46 -0800
            Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Christian Gollwitzer <auriocus@gmx.de> - 2014-11-23 10:55 +0100
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert "Frank Millman" <frank@chagford.com> - 2014-11-23 10:21 +0200
            Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-23 17:29 -0800
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-23 19:31 +1100
            Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-11-23 11:40 +0200
              Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-23 20:53 +1100
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-23 13:01 -0500
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert "Frank Millman" <frank@chagford.com> - 2014-11-24 10:05 +0200
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-24 13:44 -0500
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-25 10:17 +1100
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert "Frank Millman" <frank@chagford.com> - 2014-11-25 07:31 +0200
          Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-25 17:40 +1100
  Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-23 11:58 -0500
  Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert llanitedave <llanitedave@birdandflower.com> - 2014-11-23 18:22 -0800
    Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Chris Angelico <rosuav@gmail.com> - 2014-11-24 15:49 +1100

csiph-web