Re: trigger self recursion

From: Richard Huxton <dev(at)archonet(dot)com>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: trigger self recursion
Date: 2005-09-28 11:13:27
Message-ID: 433A7AD7.9060702@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-09-28 11:27:52 Re: trigger self recursion
Previous Message Richard Huxton 2005-09-28 11:11:13 Re: Triggers after a rule