Re: Invoke trigger after commit - Mailing list pgsql-general

From Alexander Staubo
Subject Re: Invoke trigger after commit
Date
Msg-id 88daf38c0705100443i378cd3f7g8a43a076da7cd307@mail.gmail.com
Whole thread Raw
In response to Invoke trigger after commit  (Jan Strube <js@deriva.de>)
List pgsql-general
On 5/10/07, Jan Strube <js@deriva.de> wrote:
> is there a way to invoke a trigger only if the current transaction is
> committed?
> The problem is that my trigger does some kind of logging outside the
> database and therefore must not be invoked if the transaction is rolled
> back.

PostgreSQL does not implement a kind of "on commit" trigger, but you
can simulate them using "notify" and "listen", which are
transactional:

  http://www.postgresql.org/docs/8.2/interactive/sql-notify.html

Alexander.

pgsql-general by date:

Previous
From: Jan Strube
Date:
Subject: Invoke trigger after commit
Next
From: Sim Zacks
Date:
Subject: Re: Invoke trigger after commit