Re: [GENERAL] Create Action for psql when NOTIFY Recieved

Поиск
Список
Период
Сортировка
От Steve Atkins
Тема Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Дата
Msg-id 41172781-8BF0-4AE4-BDA3-E92891B03A3F@blighty.com
обсуждение исходный текст
Ответ на Re: [GENERAL] Create Action for psql when NOTIFY Recieved  (Nico Williams <nico@cryptonector.com>)
Ответы Re: [GENERAL] Create Action for psql when NOTIFY Recieved  (Nico Williams <nico@cryptonector.com>)
Список pgsql-general
> On Sep 4, 2017, at 10:25 PM, Nico Williams <nico@cryptonector.com> wrote:
>
> On Mon, Sep 4, 2017 at 4:21 PM Steve Atkins <steve@blighty.com> wrote:
> >
>
> 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
pipeinto xargs. (Also the bare bones of a notify-based scheduler). 
>
> Without any kind of access controls on NOTIFY channels, nor any kind of payload validation, i just don't feel
comfortableusing the payload at all.  Besides, the payload is hardly necessary given that there's a database on which
youcan scribble the payload :)  It suffices that you receive a notification, and you can then check if there's anything
todo. 
>
> My version of this doesn't have connection keepalives, but that's ok because that can be added in the form of....
notifications,and the consumer of pqasyncnotifier can implement timeouts.  But i agree that timeouts and keepalives
wouldbe nice, and even invoking a given SQL function would be nice. 
>
> But the question i have is: how to get such functionality integrated into PostgreSQL?  Is a standalone program (plus
manpageplus Makefile changes) enough, or would a psql \wait command be better? 

There's not really any need to integrate it into postgresql at all. It doesn't rely on any details of the core
implementation- it's just a normal SQL client, a pretty trivial one. 

(Whether psql could usefully be reworked to listen for activity on the connection when it's not actively executing a
queryis another question). 

Cheers,
  Steve

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

Предыдущее
От: Thomas Kellerer
Дата:
Сообщение: Re: [GENERAL] What's the best way in postgres to use ANY() with LIKE '%'?
Следующее
От: Nico Williams
Дата:
Сообщение: Re: [GENERAL] Create Action for psql when NOTIFY Recieved