pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: Jean-Christophe Praud <jc@praud.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Asynchronous trigger
Date: Wed, 06 Sep 2006 15:03:12 -0700
Message-ID: <1157580192.20589.127.camel@dogma.v10.wvs> (raw)
In-Reply-To: <44FF3DAE.5050406@praud.com>
References: <44FF3DAE.5050406@praud.com>

On Wed, 2006-09-06 at 23:29 +0200, Jean-Christophe Praud wrote:
> Hi all,
> 
> I'm planning to convert an application to postgresql 8.1 (from mysql).
> Currently we have some recursive procedures done on the application side 
> we would want to rewrite as stored pl/pgsql procedures called by triggers...
> 
> Is it possible for these triggers to be asynchronous, in order not to 
> block the client application during the recursive process ?
> 

You can send the query itself asynchronously using PQsendQuery (for
libpq, see your client library's docs for a similar function). That
allows your application to continue processing, but doesn't allow you to
issue any more queries over that connection. 

You could make your trigger send a notification to an application that
just handles that one task in the background.

Regards,
	Jeff Davis






view thread (11+ messages)  latest in thread

Message-ID: <1157580192.20589.127.camel@dogma.v10.wvs>
Permalink:  ../1157580192.20589.127.camel@dogma.v10.wvs/
Also on:    postgresql.org/message-id/1157580192.20589.127.camel@dogma.v10.wvs

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: pgsql@j-davis.com, jc@praud.com
  Subject: Re: Asynchronous trigger
  In-Reply-To: <1157580192.20589.127.camel@dogma.v10.wvs>
  References: <44FF3DAE.5050406@praud.com> <1157580192.20589.127.camel@dogma.v10.wvs>

* 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