Re: triggers on prepare, commit, rollback... ? - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: triggers on prepare, commit, rollback... ?
Date
Msg-id 1211270280.8174.20.camel@huvostro
Whole thread Raw
In response to Re: triggers on prepare, commit, rollback... ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: triggers on prepare, commit, rollback... ?
List pgsql-hackers
On Mon, 2008-05-19 at 21:53 -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> >>> trigger on "prepare", "commit", "rollback", "savepoint",
> >> 
> >> This is a sufficiently frequently asked question that I wish someone 
> >> would add an entry to the FAQ about it, or add it to the TODO list's 
> >> "Features we don't want" section.
> 
> > OK, remind me why we don't want it again?
> 
> I'm sure I've ranted on this several times before, but a quick archive
> search doesn't find anything.  So, here are a few points to chew on:
> 
> * Trigger on rollback: what's that supposed to do?  

Tell others that this trx failed, maybe log a failure ?

OTOH, this can be implemented by a daemon that sits on 
"tail -f logfile | grep ROLLBACK"

> The current
> transaction is already aborted, so the trigger has no hope of making any
> database changes that will ever be visible to anyone.

after reading your explanations trigger on rollback/failure is the only
one what makes sense still, but it may be that after failure it does not
have enough state usable to report anything useful.

-----------------
Hannu




pgsql-hackers by date:

Previous
From: Steve Atkins
Date:
Subject: Re: triggers on prepare, commit, rollback... ?
Next
From: cinu
Date:
Subject: Re: Installation of Postgres 32Bit on 64 bit machine