Re: Asynchronous trigger - Mailing list pgsql-general

From Jeff Davis
Subject Re: Asynchronous trigger
Date
Msg-id 1157580192.20589.127.camel@dogma.v10.wvs
Whole thread Raw
In response to Asynchronous trigger  (Jean-Christophe Praud <jc@praud.com>)
List pgsql-general
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




pgsql-general by date:

Previous
From: Jean-Christophe Praud
Date:
Subject: Asynchronous trigger
Next
From: "Arturo Perez"
Date:
Subject: Problems with sequences