Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
> Igor wrote: > So don't create two foreign keys that come into conflict. I would never do, but the users of my tool could make that mistake. And then my tool must do, what SQLite does. Problem: SQLite's behaviour is hard to predict and tends to surprise you. Thats the reason for my questions: Ca

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Clemens Ladisch
I wrote: > Roland Wilczek wrote: >> CREATE TABLE track (artist, >> FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE >> FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT); > > This particular statement creates a table with a single foreign key > constraint. Sorry, I was wron

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
> Clemens wrote: > > > > CREATE TABLE track (artist, > > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE > > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT); > > SQLite allows pretty much anything inside a CREATE TABLE statement, and > ignores anything it doesn't recog

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Clemens Ladisch
Roland Wilczek wrote: > - If two foreign keys come into conflict, SQLite silently ignores one of them > instead of raising an error. > > CREATE TABLE track (artist, > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE CASCADE > FOREIGN KEY (artist) REFERENCES artist(id) ON DELETE RESTRICT); SQ

Re: [sqlite] Unstable ON DELETE actions

2013-07-09 Thread Igor Tandetnik
On 7/9/2013 8:50 AM, Roland Wilczek wrote: - The order of execution of ON DELETE action is not well documented. As far as I can tell, it's unspecified, subject to change without notice, and should be treated as unpredictable. If you want a deterministic order, create a single ON DELETE trigge

[sqlite] Unstable ON DELETE actions

2013-07-09 Thread Roland Wilczek
Hi *, I am sorry to introduce myself to this list with such a long posting. And I am even more sorry to post such critical content! Forgive me. I am developing an ORM-tool, which as a part of it's tasks, emulates ON DELETE actions of the underlying RDBMS. Accidentally I came across some wierdness