Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-13 Thread Manuel Rigger
Hi Ryan, Okay, thanks for the clarification! Your explanation makes sense! Best, Manuel On Mon, May 13, 2019 at 8:25 PM R Smith wrote: > On 2019/05/13 11:42 AM, Manuel Rigger wrote: > > Hi Ryan, > > > > I hope my question did not offend you. I didn't expect that the answer to > > this

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-13 Thread R Smith
On 2019/05/13 11:42 AM, Manuel Rigger wrote: Hi Ryan, I hope my question did not offend you. I didn't expect that the answer to this question would be considered to be that obvious. Goodness, I was not offended and apologies if my reply read in that way - it was just an honest account - and

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-13 Thread Manuel Rigger
Hi Ryan, I hope my question did not offend you. I didn't expect that the answer to this question would be considered to be that obvious. Best, Manuel On Mon, May 13, 2019 at 9:57 AM R Smith wrote: > On 2019/05/13 12:56 AM, Manuel Rigger wrote: > > Hi everyone, > > > > It seems that a table

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-13 Thread R Smith
On 2019/05/13 12:56 AM, Manuel Rigger wrote: Hi everyone, It seems that a table created in the temp database cannot have a parent table that is created in the main database and vice versa: PRAGMA foreign_keys=true; CREATE TABLE t0 (c0 PRIMARY KEY); CREATE TEMP TABLE t1 (c0, FOREIGN KEY(c0)

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Okay, thanks for the clarification! Best, Manuel On Mon, May 13, 2019 at 1:38 AM J. King wrote: > On May 12, 2019 7:33:20 p.m. EDT, Manuel Rigger > wrote: > > >As far as I understood, the main and temp databases are always loaded > >and > >cannot be detached. But, as you pointed out, I can

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread J. King
On May 12, 2019 7:33:20 p.m. EDT, Manuel Rigger wrote: >As far as I understood, the main and temp databases are always loaded >and >cannot be detached. But, as you pointed out, I can understand that this >makes sense in the general case. Note that the temp database is specific to a given

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Thanks for your quick response! On Mon, May 13, 2019 at 1:17 AM Simon Slavin wrote: > On 12 May 2019, at 11:56pm, Manuel Rigger wrote: > > > Is this intended? > > Yes. Because the temp database disappears when you close your connection. > So you would open a database and find that either a

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Simon Slavin
On 12 May 2019, at 11:56pm, Manuel Rigger wrote: > Is this intended? Yes. Because the temp database disappears when you close your connection. So you would open a database and find that either a parent or a child table had disappeared. Which would mean the database was corrupt. Actually

[sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Hi everyone, It seems that a table created in the temp database cannot have a parent table that is created in the main database and vice versa: PRAGMA foreign_keys=true; CREATE TABLE t0 (c0 PRIMARY KEY); CREATE TEMP TABLE t1 (c0, FOREIGN KEY(c0) REFERENCES t0(c0)); INSERT INTO t1(c0) VALUES (1);