Mark Kazemier <mark.kazem...@gmail.com> writes:
> I found a way to break a foreign key constraint in PostgreSQL
> [ ie, make a rule that defeats an ON DELETE CASCADE operation ]

This isn't a bug, it's just the way things work.  Rules (and triggers)
apply to the commands that implement foreign key updates, so a poorly
written rule can make those queries do the wrong thing.  The rule can
make your regular queries do the wrong thing too, so it's not like you'd
be fine if it were done some other way.  There are a number of real
applications that would be broken if rules/triggers *didn't* apply to
FK queries --- for example, using a trigger to implement logging --- so
we've concluded this is the most useful way for it to be done.

                        regards, tom lane

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to