Re: [PL/PGSQL] (Bug/Feature problem) with recursive Trigger

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Froggy / Froggy Corp(dot)" <froggy(at)froggycorp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [PL/PGSQL] (Bug/Feature problem) with recursive Trigger
Date: 2006-05-27 20:16:58
Message-ID: 10311.1148761018@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Froggy / Froggy Corp." <froggy(at)froggycorp(dot)com> writes:
> PG7 dont make recursiv, it wait for the end of the trigger BEFORE_UPDATE
> to call the new UPDATE stat and forgot the 3rd AFTER_UPDATE. PG8 is
> better, it call trigger like real recursiv fonction, but allways dismiss
> the 3rd AFTER UPDATE.

There isn't any third AFTER UPDATE because the updates fired by the
trigger override the pending update, and so when the trigger returns
the pending update is abandoned.

This is a really badly designed trigger anyway: why don't you just
modify the NEW row, instead of incurring orders of magnitude more work
by launching an entire new SQL command?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Froggy / Froggy Corp. 2006-05-27 20:49:17 Re: [PL/PGSQL] (Bug/Feature problem) with recursive Trigger
Previous Message Richard Smith 2006-05-27 19:13:19 Per session variables