Re: [sqlite] Write to a View

2012-11-11 Thread BareFeetWare
Hi Marco, I know we've been discussing this directly, but since you've also mentioned it here on this list, I thought a response here could also facilitate greater discussion. An updatable view is a view that will accept insert, delete and update commands, propagating changes back to the

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread stahlhut
Quoting Igor Tandetnik : stahl...@dbs.uni-hannover.de wrote: Consider these two tables: CREATE TABLE tab1 (x INTEGER PRIMARY KEY); CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); Assuming they contain the same rows, I expect any query against 'tab1' to return

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread stahlhut
Quoting Simon Slavin : On 10 Nov 2012, at 7:21pm, stahl...@dbs.uni-hannover.de wrote: Consider these two tables: CREATE TABLE tab1 (x INTEGER PRIMARY KEY); CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); Assuming they contain the same rows, I expect any query

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread Igor Tandetnik
stahl...@dbs.uni-hannover.de wrote: > Quoting Igor Tandetnik : >> stahl...@dbs.uni-hannover.de wrote: >>> Consider these two tables: >>> >>> CREATE TABLE tab1 (x INTEGER PRIMARY KEY); >>> CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); >>> >>> Assuming they

[sqlite] Confusion on 'foreign key mismatch' errors

2012-11-11 Thread Darren Spruell
I'm stuck on some errors related to my use of foreign key constraints in my application. The following illustrates: $ sqlite3 SQLite version 3.7.9 --SOURCE-ID-- Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> PRAGMA foreign_keys = ON; sqlite> CREATE VIRTUAL TABLE

Re: [sqlite] Confusion on 'foreign key mismatch' errors

2012-11-11 Thread Pavel Ivanov
> # http://answers.oreilly.com/topic/1955-how-to-use-full-text-search-in-sqlite/ > Unlike traditional tables, the ROWID of an FTS table is stable through > a vacuum (VACUUM in Appendix C), so it can be reliably referenced > through a foreign key. I'm not sure who wrote that but this page

Re: [sqlite] Confusion on 'foreign key mismatch' errors

2012-11-11 Thread Simon Slavin
On 12 Nov 2012, at 5:49am, Darren Spruell wrote: > sqlite> CREATE TABLE ip ( > ...> id INTEGER PRIMARY KEY, date_added DEFAULT CURRENT_DATE, > ...> ip VARCHAR(15) NOT NULL UNIQUE, comment INTEGER NOT NULL, > ...> FOREIGN

Re: [sqlite] Confusion on 'foreign key mismatch' errors

2012-11-11 Thread Darren Spruell
On Sun, Nov 11, 2012 at 11:16 PM, Simon Slavin wrote: > > On 12 Nov 2012, at 5:49am, Darren Spruell wrote: > >> sqlite> CREATE TABLE ip ( >> ...> id INTEGER PRIMARY KEY, date_added DEFAULT CURRENT_DATE, >> ...> ip