Re: Background triggers?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dick Visser <visser(at)terena(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Background triggers?
Date: 2009-08-19 19:45:34
Message-ID: 27827.1250711134@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Dick Visser <visser(at)terena(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Stark 2009-08-19 19:47:49 Re: Background triggers?
Previous Message Tino Schwarze 2009-08-19 19:41:24 Re: Background triggers?