[GENERAL] Create Action for psql when NOTIFY Recieved - Mailing list pgsql-general

From Jerry Regan
Subject [GENERAL] Create Action for psql when NOTIFY Recieved
Date
Msg-id ADDB899C-FA71-4FFE-8B52-0627E594DB4B@concertoglobalresources.com
Whole thread Raw
Responses Re: [GENERAL] Create Action for psql when NOTIFY Recieved  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [GENERAL] Create Action for psql when NOTIFY Recieved  (Nico Williams <nico@cryptonector.com>)
List pgsql-general
I have a 9.4 database. I think I’ve read all the LISTEN and NOTIFY entries in PostgreSQL documentation.

I’ve done internet searches, hopefully asking the correct question.

But I’m stumped.

I want psql to LISTEN for a NOTIFY that a trigger, yet to be defined, issues AFTER INSERT into the table. I think I know how to do all this.

My concern is how, after LISTENing in psql, I can tell it what to do when the NOTItFY is received.

In my internet searches, I found scripts to be used with Twisted. I don’t have Twisted, I don’t want to install Twisted. I just want psql to return a column from the table and hand it off to a process external to psql. I believe I know how to call external processes from psql.

My issue returns to, how do I tell psql what to do when it receives a NOTIFY? I don’t see anything in the docs for LISTEN except to specify the channel - nothing about what to do when the NOTIFY (with what ever parameters might be included) is detected.

/s/jr
Consultant
Concerto GR
Mobile: 612.208.6601

Concerto - a composition for orchestra and a soloist



pgsql-general by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [GENERAL] Performance with high correlation in group by on PK
Next
From: Devrim Gündüz
Date:
Subject: Re: [GENERAL] Installing 9.5 doesn't create 'postgres' unix accounton Cent OS 7