Search Postgresql Archives

Re: BEFORE ... Statement-level trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/18/19 9:11 AM, Jitendra Loyal wrote:
I have gone through the documentation quite a number of times to establish the understanding. However, I had been wondering about the recursion in the case I put forth.

Is there a better way to handle this requirement? The point is that the trigger is being called when no rows are affected.

Well as the docs say a FOR EACH STATEMENT trigger will execute in the absence of changed rows. So you have two options:

1) Use a FOR EACH ROW trigger.

2) Do what you did and include a sanity check.

Best guess is your AFTER STATEMENT trigger is tripping your BEFORE ROW trigger which then trips your AFTER STATEMENT and so on.


Thanks and regards,
Jiten


--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux