Re: Create Action for psql when NOTIFY Recieved

From: Nico Williams <nico(at)cryptonector(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Jerry Regan <jerry(dot)regan(at)concertoglobalresources(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create Action for psql when NOTIFY Recieved
Date: 2017-09-04 03:02:38
Message-ID: 20170904030237.GE3281@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Sep 03, 2017 at 05:37:57PM -0500, Nico Williams wrote:
> What would it take to have pqasyncnotifier [0] adopted by PostgreSQL?

Maybe it should be named pqasynclisterner.

A \wait command for psql could do the same thing. I could probably
write such a patch at some point if there's interest, something like:

\wait [[N] [statement]]

that waits for N NOTIFYies (or forever if N is -1), perhaps always
printing the payload, but with newlines escaped (or truncated at
newlines) to avoid needing options, and runs a statement if provided.

Nico
--

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stefan Wagner 2017-09-04 09:32:50 Undefined Reference
Previous Message Nico Williams 2017-09-03 22:37:57 Re: Create Action for psql when NOTIFY Recieved