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