Re: background triggers?

From: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
To: Sim Zacks <sim(at)compulab(dot)co(dot)il>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: background triggers?
Date: 2006-05-23 22:20:06
Message-ID: 44738A96.9000904@phlo.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sim Zacks wrote:
> Is there any way to write a statement trigger that runs in the
> background? In my testing, when I have an After Insert For Each
> Statement trigger, the function call does not end until the trigger is
> finished processing.
>
> What I would like to do, and please let me know if there is a better way
> to do this, is to have an after event statement trigger run in a
> separate process so the function call ends when it ends and the
> statement trigger gets executed on its own time.
Create some queue table, and let the after-statement trigger insert a
record into the queue.

Some daemon, or a cron-job, can then periodically check the queue, and
perform the action you want to do asynchronously.

If you don't want to use polling to find new queue entries, you can use
notify/listen to inform the daemon of new queue entries.

greetings, Florian Pflug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jim C. Nasby 2006-05-23 22:22:28 Re: HELP!!!ERROR:operator does not exist:arc+arc
Previous Message Jim C. Nasby 2006-05-23 22:19:58 Re: allow LIMIT in UPDATE and DELETE