Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to disable trigger within itself? (to prevent recursion/loop)

3 views
Skip to first unread message

Jaroslav Záruba

unread,
Nov 11, 2009, 4:39:56 AM11/11/09
to
Hello

I have this trigger which ON INSERT inserts more rows into the very
same table it "sits" on. To avoid an INSERT-recursion I would like to
disable all triggers on that table from within my trigger-function.
But what I get is an ERROR saying that I can not alter table because
it is being used.
Is there something I can do about this?
(I do have a workadound, there is one field by which I can tell
whether the insert comes from a trigger or not.)

Best regards
J. Záruba

Laurenz Albe

unread,
Nov 11, 2009, 10:11:29 AM11/11/09
to

Your workaround is the only option I can think of.

Yours,
Laurenz Albe


Jaroslav Záruba

unread,
Nov 11, 2009, 10:21:33 AM11/11/09
to
On Nov 11, 4:11 pm, "Laurenz Albe" <inv...@spam.to.invalid> wrote:

OK, thank you. :)
regards
JZ

0 new messages