Re: pre-commit triggers - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: pre-commit triggers
Date
Msg-id 528880BE.6070508@2ndQuadrant.com
Whole thread Raw
In response to Re: pre-commit triggers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pre-commit triggers
Re: pre-commit triggers
List pgsql-hackers
On 11/17/2013 01:42 AM, Tom Lane wrote:
> Hannu Krosing <hannu@2ndQuadrant.com> writes:
>> I have not looked at the patch, but does it also run pre-rollback ?
> error in trigger -> instant infinite loop.
Means this needs to have some kind of recursion depth limit, like python

>>> def x():
...     return x()
...
>>> x()
... (a few thousand messages like the following) ... File "<stdin>", line 2, in x
RuntimeError: maximum recursion depth exceeded

>
> Besides, exactly what would you do in such a trigger?  
The use case would be telling another system about the rollback.

Basically sending a "ignore what I told you to do" message

So it would send a network message, a signal or writing something to
external file.

> Not modify
> the database, for certain, because we're about to roll back.
>
>             regards, tom lane

Cheers

-- 
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ




pgsql-hackers by date:

Previous
From: Sawada Masahiko
Date:
Subject: Re: Logging WAL when updating hintbit
Next
From: Ian Lawrence Barwick
Date:
Subject: Review: pset autocomplete add missing options