On Fri, Nov 9, 2018 at 8:26 AM Simon Slavin <slav...@bigfraud.org> wrote:

> On 9 Nov 2018, at 7:11am, Hick Gunter <h...@scigames.at> wrote:
> > Foreign keys are ignored by default and need to be explicitly enabled. I
> would expect this to include everything that relates to foreign keys.
> > I've casually discovered that the behavior of ALTER TABLE RENAME TO
> (versione 3.25.x) seems to be affected by an odd glitch; FOREIGN KEY
> constraints are updated as expected only when PRAGMA foreign_keys=1,
> otherwise they are just ignored.
>
> While your statement is correct, I would argue that the behaviour is
> harmful, and cannot possibly be what any programmer could want to happen.
> Think how difficult it would be to diagnose this having happened, and then
> fix the problem it would create.
> I might argue that correct behaviour would be to transform FOREIGN KEY
> constraints even when the PRAGMA is off.  Or I might argue that the attempt
> should generate an error result (SQLITE_MISUSE ?).
>

Foreign keys are ignored in the sense they are not enforced, but they are
still parsed AFAIK.
As such, I agree with Simon that it's harmful to not update them on table
(or column) renames. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to