Re: Create Action for psql when NOTIFY Recieved

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Create Action for psql when NOTIFY Recieved
Date: 2017-09-04 21:18:55
Message-ID: 836CE0BD-553A-4A1F-80FC-E8F136D0F372@blighty.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On Sep 3, 2017, at 3:32 PM, Nico Williams <nico(at)cryptonector(dot)com> wrote:
>
>
> My principal problem with psql(1) relative to NOTIFY/LISTEN is that
> psql(1) won't check for them until it has had some input on stdin. So
> it will appear to do nothing when it's idle, even if there millions of
> notifies for it to respond to!
>
> So I wrote a program to just LISTEN: https://github.com/twosigma/postgresql-contrib/blob/master/pqasyncnotifier.c

Me too.

https://github.com/wttw/pgsidekick

Select-based, sends periodic keep-alives to keep the connection open, outputs payloads in a way that's friendly to pipe into xargs. (Also the bare bones of a notify-based scheduler).

Cheers,
Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Murphy 2017-09-05 02:10:01 What's the best way in postgres to use ANY() with LIKE '%'?
Previous Message Seamus Abshere 2017-09-04 20:23:00 Surprising locking behavior with CTE, FOR SHARE, and UPDATE