dbTalk Databases Forums  

Re: [BUGS] BUG #6632: "before delete" triggers that delete rows fromthe same table can invalidate constraints

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #6632: "before delete" triggers that delete rows fromthe same table can invalidate constraints in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ignas Mikalajunas
 
Posts: n/a

Default Re: [BUGS] BUG #6632: "before delete" triggers that delete rows fromthe same table can invalidate constraints - 05-07-2012 , 10:09 AM






On Mon, May 7, 2012 at 6:06 PM, Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> wrote:
Quote:
ignas (AT) pow (DOT) lt writes:
[ you can sabotage foreign key constraints with triggers ]

This is not a bug, it's a "don't do that" issue. *The only way to
prevent it would be to not fire triggers during FK operations, or
to somehow restrict what triggers are allowed to do, and either of
those cures would be worse than the disease.

In general, it's bad design to use a BEFORE trigger to propagate changes
to other rows; you should do that in AFTER triggers. *See the
documentation.

* * * * * * * * * * * *regards, tom lane
I see, thank you very much for the explanation.

Ignas

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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.