Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'subject:Python': 0.06; 'concurrently': 0.07; 'definitions': 0.07; 'made.': 0.07; 'suddenly': 0.07; 'users,': 0.07; 'accepted,': 0.09; 'development)': 0.09; 'mind,': 0.09; 'read-only': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:2.7': 0.09; '(which,': 0.16; '>the': 0.16; 'command,': 0.16; 'covered,': 0.16; 'deletes': 0.16; 'incomplete': 0.16; 'ios': 0.16; 'message- id:@4ax.com': 0.16; 'qualifying': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'referencing': 0.16; 'where?': 0.16; 'ignore': 0.16; 'seems': 0.21; 'example': 0.22; '"you': 0.24; 'url:home': 0.24; 'chapter': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'addressed.': 0.29; 'mode': 0.30; 'statement': 0.30; 'dropped': 0.31; 'enforce': 0.31; "user's": 0.31; 'says': 0.33; 'table': 0.34; 'but': 0.35; 'add': 0.35; '+0200,': 0.36; 'skip:> 10': 0.36; "didn't": 0.36; 'charset :us-ascii': 0.36; 'list': 0.37; 'remote': 0.38; 'nov': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'received:org': 0.40; 'even': 0.60; 'most': 0.60; 'first': 0.61; 'complete': 0.62; 'such': 0.63; 'field': 0.63; 'more': 0.64; 'default': 0.69; 'foreign': 0.74; 'capability': 0.84; 'enforcement': 0.84; 'edition': 0.86; 'acknowledge': 0.93; 'chapters': 0.93; 'imagine': 0.93; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert Date: Sun, 23 Nov 2014 13:01:39 -0500 Organization: IISS Elusive Unicorn References: <5d474a87-e2a5-43d3-b07c-4a1194880b4d@googlegroups.com> <54716987.7040301@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-223-115.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 39 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416765706 news.xs4all.nl 2848 [2001:888:2000:d::a6]:37015 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:81396 On Sun, 23 Nov 2014 10:21:48 +0200, "Frank Millman" declaimed the following: > > >The default is for sqlite3 to ignore foreign key contraints. > Considering the first edition of the Definitive Guide didn't even have foreign key definitions and relied upon defining triggers... I was about to think the second edition of the book (which, in my mind, dropped a lot of reference content [no chapter on the SQL syntax accepted, one has to look up each statement in whatever chapter gave an example of it] to add chapters specific to iOS and Android phone/tablet development) listed the syntax more as a "something that will come in the future". No list of pragmas in the second edition book either -- the chapter on them says only the most popular will be covered, and has the rather incomplete statement "You can find a complete list of pragmas." Duh, where? > >Unfortunately it has a limitation, which they acknowledge but they say is >unlikely to be addressed. You can access more than one database concurrently >by using the 'attach' command, and qualifying a remote tablename as >{database} dot {tablename}. You can then include the remote table in any sql >command. However, it will not enforce foreign key constraints across >databases. > Seems acceptable-- as such enforcement would require it to automatically reattach (likely in both directions) any/all attached databases when a change is made. Imagine the thrashing if one has some master database in a read-only mode for most users, and each user has some child database referencing some field in the master... And the owner of the master database deletes a record... Are they suddenly going to have to have update capability on every user's database to check/enforce multi-db references? -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/