Re: proposal: make NOTIFY list de-duplication optional - Mailing list pgsql-hackers

From Catalin Iacob
Subject Re: proposal: make NOTIFY list de-duplication optional
Date
Msg-id CAHg_5grojD+2CNW9UULOGkB5uLf4XJ3ntzRHPX_J=C2BGrRbaw@mail.gmail.com
Whole thread Raw
In response to Re: proposal: make NOTIFY list de-duplication optional  (Filip Rembiałkowski <filip.rembialkowski@gmail.com>)
List pgsql-hackers
On Sat, Feb 20, 2016 at 2:00 PM, Filip Rembiałkowski
<filip.rembialkowski@gmail.com> wrote:
> I was stuck because both syntaxes have their ugliness. NOTIFY allows the
> payload to be NULL:
> NOTIFY chan01;
>
> How would this look like in "never" mode?
> NOTIFY chan01, NULL, 'never'; -- seems very cryptic.

The docs say:
"The information passed to the client for a notification event
includes the notification channel name, the notifying session's server
process PID, and the payload string, which is an empty string if it
has not been specified."

So a missing payload is not a SQL NULL but an empty string. This means
you would have:
NOTIFY chan01;
NOTIFY chan01, ''; -- same as above
NOTIFY chan01, '', 'maybe'; -- same as above
NOTIFY chan01, '', 'never'; -- send this all the time

Seems ok to me.



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: postgres_fdw vs. force_parallel_mode on ppc
Next
From: Michael Paquier
Date:
Subject: Re: Writing new unit tests with PostgresNode