Re: triggers on prepare, commit, rollback... ?

From: James Mansion <james(at)mansionfamily(dot)plus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Fabien COELHO <fabien(dot)coelho(at)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: triggers on prepare, commit, rollback... ?
Date: 2008-05-20 05:38:17
Message-ID: 483263C9.5020808@mansionfamily.plus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> * Trigger on rollback: what's that supposed to do? The current
> transaction is already aborted, so the trigger has no hope of making any
> database changes that will ever be visible to anyone.
>
It can however affect state in the backend doing the rollback, which can
be useful.
> * Trigger on commit: what do you do if the transaction fails after
> calling the trigger? The reductio ad absurdum for this is to consider
> having two on-commit triggers, where obviously the second one could
> fail.
>
Ditto - this is effectively at the point where messaging for NOTIFY
happens, and if it
fails then that's tough. If you need to implement a custom NOTIFY, this
is where to do it.

> Another response I've heard is "but I don't want to make
> inside-the-database changes, I want to propagate the state to someplace
> external". Of course that's completely broken too, because there is
>
You really are being absurdly judgemental here. _You_ may not have a
use case, but
that does not mean that no-one else does. Some things are idempotent
and are
effectively hints - that they are not transacted can be well understood and
accomodated.

Is 'Tom doesn't need it' an adequate reason to take such a hard line?

James

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Steve Atkins 2008-05-20 06:01:36 Re: triggers on prepare, commit, rollback... ?
Previous Message Andrew Chernow 2008-05-20 04:28:54 Re: libpq object hooks (libpq events)