Re: Asynchronous Trigger? - Mailing list pgsql-general

From Michael Loftis
Subject Re: Asynchronous Trigger?
Date
Msg-id CAHDg04sckCAWdVbepAkYrFzjV8ukORCCTqXzpim2hSWXaUw9QA@mail.gmail.com
Whole thread Raw
In response to Asynchronous Trigger?  (Cory Tucker <cory.tucker@gmail.com>)
Responses Re: Asynchronous Trigger?  (Adam Tauno Williams <awilliam@whitemice.org>)
List 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@ya.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


pgsql-general by date:

Previous
From: Fabio Ugo Venchiarutti
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?
Next
From: Andres Freund
Date:
Subject: Re: Can PostgreSQL create new WAL files instead of reusing old ones?