Re: background triggers?

Поиск
Список
Период
Сортировка
От Florian G. Pflug
Тема Re: background triggers?
Дата
Msg-id 44738A96.9000904@phlo.org
обсуждение исходный текст
Ответ на background triggers?  (Sim Zacks <sim@compulab.co.il>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: allow LIMIT in UPDATE and DELETE
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: HELP!!!ERROR:operator does not exist:arc+arc