Re: trigger self recursion - Mailing list pgsql-general

From Richard Huxton
Subject Re: trigger self recursion
Date
Msg-id 433A7AD7.9060702@archonet.com
Whole thread Raw
In response to trigger self recursion  ("Sim Zacks" <sim@compulab.co.il>)
List pgsql-general
Sim Zacks wrote:
> Is there a way to avoid trigger self-recursion?
> In other words, update a table and have the trigger update another row in
> the same table without calling the same trigger?

No a per-row trigger will fire for every row updated.

There is presumably some test you can make to see whether your trigger
should do any work, or just exit. I have seen people on the list who
wrote the test in "C" and put the work in a separate function, but have
never needed that level of complexity myself.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Triggers after a rule
Next
From: Sim Zacks
Date:
Subject: Re: trigger self recursion