Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-24 Thread Frank Millman
Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:8d747a5biq4rc559tvgju088508bp0o...@4ax.com... On Sun, 23 Nov 2014 10:21:48 +0200, Frank Millman fr...@chagford.com declaimed the following: The default is for sqlite3 to ignore foreign key contraints. [...] Unfortunately it has

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-24 Thread Chris Angelico
On Tue, Nov 25, 2014 at 5:44 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Mon, 24 Nov 2014 10:05:11 +0200, Frank Millman fr...@chagford.com declaimed the following: I will explain why such a feature would have been useful for me. My accounting system handles multiple companies. I

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-24 Thread Frank Millman
Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:lrr67al6ppa852agu9rq2dstqtue17i...@4ax.com... On Mon, 24 Nov 2014 10:05:11 +0200, Frank Millman fr...@chagford.com declaimed the following: Originally I supported two databases - PostgreSQL and Sql Server. They both have a

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-24 Thread Chris Angelico
On Tue, Nov 25, 2014 at 4:31 PM, Frank Millman fr...@chagford.com wrote: Dennis Lee Bieber wlfr...@ix.netcom.com wrote in message news:lrr67al6ppa852agu9rq2dstqtue17i...@4ax.com... We must have a different impression of what a schema consists of. As I learned it, the schema basically came

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Frank Millman
Chris Angelico ros...@gmail.com wrote in message news:captjjmp4y5zowwn5yftjutko4h5jvtqlantwqepa6b35xnd...@mail.gmail.com... Entirely possible. I never did track down the actual cause of the SQLite3 issues my students were having; though I suspect it's not purely a Python API issue. I tried

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Chris Angelico
On Sun, Nov 23, 2014 at 7:21 PM, Frank Millman fr...@chagford.com wrote: Chris Angelico ros...@gmail.com wrote in message news:captjjmp4y5zowwn5yftjutko4h5jvtqlantwqepa6b35xnd...@mail.gmail.com... Entirely possible. I never did track down the actual cause of the SQLite3 issues my students

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Jussi Piitulainen
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

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Chris Angelico
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

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Christian Gollwitzer
Am 23.11.14 07:32, schrieb Chris Angelico: did a sequence of commands which ought to have failed, but didn't. Let's see if I can recreate this: rosuav@sikorsky:~$ sqlite3 SQLite version 3.7.13 2012-06-11 02:05:22 Enter .help for instructions Enter SQL statements terminated with a ; sqlite

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread llanitedave
On Sunday, November 23, 2014 12:22:30 AM UTC-8, Frank Millman wrote: Chris Angelico ros...@gmail.com wrote in message news:captjjmp4y5zowwn5yftjutko4h5jvtqlantwqepa6b35xnd...@mail.gmail.com... Entirely possible. I never did track down the actual cause of the SQLite3 issues my students

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread llanitedave
On Saturday, November 22, 2014 6:11:22 PM UTC-8, llanitedave wrote: I've built a database in SQLite3 to be embedded into a python application using wxPython 2.8.12 and Python 2.7.6. I'm using Sqliteman to manage the database directly and make changes to the structure when necessary. One

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-23 Thread Chris Angelico
On Mon, Nov 24, 2014 at 1:22 PM, llanitedave llanited...@birdandflower.com wrote: I recreated the table and put the foreign key reference directly into the field definition: of_borehole TEXT NOT NULL REFERENCES borehole, This is a valid alternative according to the SQLite3 docs, if you

SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread llanitedave
I've built a database in SQLite3 to be embedded into a python application using wxPython 2.8.12 and Python 2.7.6. I'm using Sqliteman to manage the database directly and make changes to the structure when necessary. One item that's been bugging me is when I'm inserting records into one

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread Chris Angelico
On Sun, Nov 23, 2014 at 1:11 PM, llanitedave llanited...@birdandflower.com wrote: logging.info(Related borehole_id is %s, of_borehole is %s, relatedbh, runfields[1]) In this case, the displayed data from both is identical -- the logging line comes back as: INFO:Related borehole_id is

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread llanitedave
On Saturday, November 22, 2014 6:22:32 PM UTC-8, Chris Angelico wrote: On Sun, Nov 23, 2014 at 1:11 PM, llanitedave wrote: logging.info(Related borehole_id is %s, of_borehole is %s, relatedbh, runfields[1]) In this case, the displayed data from both is identical -- the logging line

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread Michael Torrie
On 11/22/2014 08:54 PM, llanitedave wrote: Well that DID make a difference! I used the %r marker, and the logger line gave me back: INFO:Related borehole_id is u'testbh3', of_borehole is 'testbh3' So it looks like I need to change my foreign key string to a unicode string. I'll be working

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread Chris Angelico
On Sun, Nov 23, 2014 at 3:58 PM, Michael Torrie torr...@gmail.com wrote: On 11/22/2014 08:54 PM, llanitedave wrote: Well that DID make a difference! I used the %r marker, and the logger line gave me back: INFO:Related borehole_id is u'testbh3', of_borehole is 'testbh3' So it looks like I

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread llanitedave
On Saturday, November 22, 2014 9:41:55 PM UTC-8, Chris Angelico wrote: On Sun, Nov 23, 2014 at 3:58 PM, Michael Torrie wrote: On 11/22/2014 08:54 PM, llanitedave wrote: Well that DID make a difference! I used the %r marker, and the logger line gave me back: INFO:Related borehole_id is

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread Chris Angelico
On Sun, Nov 23, 2014 at 5:08 PM, llanitedave llanited...@birdandflower.com wrote: The application was working correctly earlier (meaning that I could enter and retrieve data with it; being a strictly user application it didn't allow deletes from the GUI), and then I discovered (while cleaning

Re: SQLite3 in Python 2.7 Rejecting Foreign Key Insert

2014-11-22 Thread llanitedave
On Saturday, November 22, 2014 10:32:30 PM UTC-8, Chris Angelico wrote: On Sun, Nov 23, 2014 at 5:08 PM, llanitedave wrote: The application was working correctly earlier (meaning that I could enter and retrieve data with it; being a strictly user application it didn't allow deletes from