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

Поиск
Список
Период
Сортировка
От Nico Williams
Тема Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Дата
Msg-id 20170905162918.GF3281@localhost
обсуждение исходный текст
Ответ на Re: [GENERAL] Create Action for psql when NOTIFY Recieved  (Steve Atkins <steve@blighty.com>)
Список pgsql-general
On Tue, Sep 05, 2017 at 08:19:13AM -0700, Steve Atkins wrote:
> > 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:
> > > https://github.com/wttw/pgsidekick

[BTW, I must say I like pgsidekick, but for the use of the payload bit.]

> > But the question i have is: how to get such functionality integrated
> > into PostgreSQL?  Is a standalone program (plus manpage plus
> > 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.

It's a bit of an FAQ though, isn't it.  I do think it odd that PG has
this functionality on the server side and in the client-side API, but
its client-side utility functionality for it is very limited.

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

A \wait would simply wait for notifications from the server.  It would
be interruptible by ^C, but it would not listen for input on stdin.  I
think that should be a simple-enough patch to psql.

Nico
--


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

Предыдущее
От: Steve Atkins
Дата:
Сообщение: Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Следующее
От: Yan Pas
Дата:
Сообщение: [GENERAL] Postgresql init and cleanup module functions