Re: Asynchronous Trigger?

From: Michael Loftis <mloftis(at)wgops(dot)com>
To: Olleg Samoylov <splarv(at)ya(dot)ru>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Asynchronous Trigger?
Date: 2018-04-27 17:25:09
Message-ID: CAHDg04sckCAWdVbepAkYrFzjV8ukORCCTqXzpim2hSWXaUw9QA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

As suggested, note in ToDo table, also maybe look at LISTEN and NOTIFY
and have a job runner process LISTENing (and cleaning up the queue,
or, marking an item as in progress if you've multiple workers) The
work queue table is to help maintain state...if noone is LISTENing
then the table acts as backup so when a worker fires up it can start
working on whatever's already there and empty that.

On Fri, Apr 27, 2018 at 4:46 AM, Olleg Samoylov <splarv(at)ya(dot)ru> wrote:
> Try to look at PGQ from SkyTools.
>
> On 2018-03-30 01:29, Cory Tucker wrote:
>
> Is it possible to have the execution of a trigger (or any function) not
> block the completion of the statement they are associated with?
>
> A pattern I had hoped to implement was to do a quick update of rows that
> signaled they needed attention, and then an async per-row trigger would come
> and do the maintenance (in this case, make an expensive materialized view).
>
> Any suggestions welcome.
>
> thanks!
> --Cory
>
>

--

"Genius might be described as a supreme capacity for getting its possessors
into trouble of all kinds."
-- Samuel Butler

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andres Freund 2018-04-27 17:33:40 Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Previous Message Fabio Ugo Venchiarutti 2018-04-27 16:54:17 Re: Can PostgreSQL create new WAL files instead of reusing old ones?