Re: ROLLBACK triggers?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: ROLLBACK triggers?
Дата
Msg-id 878xt6wvco.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: ROLLBACK triggers?  ("Jim C. Nasby" <jnasby@pervasive.com>)
Список pgsql-hackers
"Jim C. Nasby" <jnasby@pervasive.com> writes:

> On Mon, Jan 23, 2006 at 06:35:18PM +0900, Daisuke Maki wrote:
> > A quick scan of the docs and the source code tree seems to indicate that
> > there is no such thing as a rollback trigger, short of hacking it.
> > 
> > Now, I'm wondering:
> >   1. Is there a rollback/commit trigger? If not, is it planned to be
> >      implemented at all?
> >   2. Is there a way to undo changes to data external to postgres
> >      when a rollback occurs, OR, only update that external data
> >      when a commit occurs?
> 
> Actually, this is something that often comes up in terms of
> LISTEN/NOTIFY and doing external non-transactional stuff like sending
> emails. AFAIK there's no plans to add support for anything like a
> rollback trigger.

Well, note that in the case of LISTEN/NOTIFY the receiving side doesn't see
the message until the sender commits. Precisely to maintain transactional
integrity.

If the external work can never fail then it seems like just postponing the
processing of it until transaction commit time like deferred constraints would
be better. I'm not sure you can really do that currently though.

-- 
greg



В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: ROLLBACK triggers?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Libpq COPY optimization