Re: Allow LISTEN on patterns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Allow LISTEN on patterns
Date
Msg-id 321080.1741195558@sss.pgh.pa.us
Whole thread Raw
In response to Re: Allow LISTEN on patterns  (Trey Boudreau <trey@treysoft.com>)
List pgsql-hackers
Trey Boudreau <trey@treysoft.com> writes:
> I didn’t see any past references to the pg_notify() ‘anomaly’:

> LISTEN FOO;
> NOTIFY FOO, ‘BAR’; -- notification delivered
> PERFORM pg_notify(‘FOO’, ‘BAR’); -- notification NOT delivered
> PERFORM pg_notify(‘foo’, ‘BAR’); -- notification delivered

> Can we come to some agreement on if we should consider this a bug?

I don't think it's a bug particularly.  The actual channel name
being listened to is lowercase "foo", per the usual SQL identifier
case-folding rules.  But pg_notify is taking a literal not an
identifier, so you have to match case.

We do have some functions that downcase the input string unless
double-quoted, so that the experience is closer to what you get
for a SQL identifier.  Perhaps pg_notify should have done that
for the channel name, but it didn't and I think it's much too late
to revisit that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: Adding support for SSLKEYLOGFILE in the frontend
Next
From: Bertrand Drouvot
Date:
Subject: Re: per backend WAL statistics