pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mike Rylander <mrylander@gmail.com>
To: weigelt@metux.de
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: detaching triggers
Date: Sun, 27 Mar 2005 16:20:27 +0000
Message-ID: <b918cf3d050327082052be653e@mail.gmail.com> (raw)
In-Reply-To: <20050327154102.GA16122@nibiru.borg.metux.de>
References: <20050327154102.GA16122@nibiru.borg.metux.de>

On Sun, 27 Mar 2005 17:41:02 +0200, Enrico Weigelt <weigelt@metux.de> wrote:
> 
> Hi folks,
> 
> is it somehow possible to detach trigger, so the calling transaction
> can return immediately, even before the trigger function has
> returned.

No, but see below.

> The only solution I currently know is to fill somethings in a queue
> table by rule and have an external daemon looking at it every second.
> But this doesnt seem very optimal for me.

Take a look at the LISTEN/NOTIFY interfaces in the docs.  This will
allow async post-transaction processing.  You can set up an ALSO rule
to notify when a particular type of statement has executed against
your target table.

http://www.postgresql.org/docs/8.0/static/sql-listen.html
http://www.postgresql.org/docs/8.0/static/sql-notify.html

See the bottom of:
http://www.postgresql.org/docs/8.0/static/sql-createrule.html

Hope that helps!

-- 
Mike Rylander
mrylander@gmail.com
GPLS -- PINES Development
Database Developer
http://open-ils.org



view thread (2+ messages)

Message-ID: <b918cf3d050327082052be653e@mail.gmail.com>
Permalink:  ../b918cf3d050327082052be653e@mail.gmail.com/
Also on:    postgresql.org/message-id/b918cf3d050327082052be653e@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mrylander@gmail.com, weigelt@metux.de
  Subject: Re: detaching triggers
  In-Reply-To: <b918cf3d050327082052be653e@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox