Create Action for psql when NOTIFY Recieved

From: Jerry Regan <jerry(dot)regan(at)concertoglobalresources(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Create Action for psql when NOTIFY Recieved
Date: 2017-08-28 20:28:19
Message-ID: ADDB899C-FA71-4FFE-8B52-0627E594DB4B@concertoglobalresources.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim Gündüz 2017-08-28 22:07:45 Re: Installing 9.5 doesn't create 'postgres' unix account on Cent OS 7
Previous Message Jeff Janes 2017-08-28 19:32:19 Re: Performance with high correlation in group by on PK