Re: Invoke trigger after commit

From: "Alexander Staubo" <alex(at)purefiction(dot)net>
To: "Jan Strube" <js(at)deriva(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Invoke trigger after commit
Date: 2007-05-10 11:43:14
Message-ID: 88daf38c0705100443i378cd3f7g8a43a076da7cd307@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/10/07, Jan Strube <js(at)deriva(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Leif B. Kristensen 2007-05-10 12:07:45 Re: Views- Advantages and Disadvantages
Previous Message Jan Strube 2007-05-10 11:14:27 Invoke trigger after commit