Re: Background triggers? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Background triggers?
Date
Msg-id 27827.1250711134@sss.pgh.pa.us
Whole thread Raw
In response to Background triggers?  (Dick Visser <visser@terena.org>)
List pgsql-admin
Dick Visser <visser@terena.org> writes:
> Ideally I would like the trigger to fire and then do the actual work in
> the background, but I found no way of doing this.

> So I came to NOTIFY/LISTEN. But because there a several pieces of
> software talking to the database, this is not ideal either.

Well, the traditional solution is to have a trigger or rule that fires
the NOTIFY.  You don't need any cooperation from the client apps.

> Is there a way to trigger stuff using NOTIFY/LISTEN, but WITHOUT an
> external client doing the magic?

No.  You need a dedicated client process that just sits there waiting
for notifies.  (Well, it might be able to do some other useful work
too, but the simplest way is to dedicate a connection for this.)

            regards, tom lane

pgsql-admin by date:

Previous
From: Dick Visser
Date:
Subject: Background triggers?
Next
From: Greg Stark
Date:
Subject: Re: Background triggers?