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

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Дата
Msg-id CAKFQuwZC-8r9EuhcdVYdUjtxiQeJOhn6D8-39aSGG5VK--DPTg@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Create Action for psql when NOTIFY Recieved  (Jerry Regan <jerry.regan@concertoglobalresources.com>)
Ответы Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Список pgsql-general
On Mon, Aug 28, 2017 at 1:28 PM, Jerry Regan <jerry.regan@concertoglobalresources.com> wrote:
My concern is how, after LISTENing in psql, I can tell it what to do when the NOTItFY is received.

​As far as I am aware you cannot.  The docs for psql, and its feature set, with respect to LISTEN, are minimal and basically say psql will print out notifications to stdout (this I'm forced to assume or read the code) and will poll for notifications whenever it sends a query to the server.


​"​Whenever a command is executed, psql also polls for asynchronous notification events generated by LISTEN and NOTIFY."

I suspect the feature request would be something like:

\set NOTIFY_PROGRAM './process-notify-request.bash'  (or an equivalent meta-command)

And psql would invoke said program and pass the content of the notification payload to it via stdin.

Given what we allow for "\copy" I don't see any technical or conceptual problems with such a feature.  Just needs someone to be its primary author.

David J.

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

Предыдущее
От: Devrim Gündüz
Дата:
Сообщение: Re: [GENERAL] Installing 9.5 doesn't create 'postgres' unix accounton Cent OS 7
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] Create Action for psql when NOTIFY Recieved