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