Re: Allow LISTEN on patterns

2025-03-05 Thread Quan Zongliang
On 2025/3/4 23:57, Trey Boudreau wrote: On Mar 3, 2025, at 10:39 PM, Quan Zongliang wrote: I implemented a LISTEN command that supports matching names in the LIKE format. Just like LISTEN 'c%'; NOTIFY c1;NOTIFY c2; Notifications are received for c1 and c2. The parser down-cases Col

Re: Allow LISTEN on patterns

2025-03-05 Thread Quan Zongliang
On 2025/3/6 00:42, Tom Lane wrote: Aleksander Alekseev writes: For instance, if I do: ``` LISTEN aaafoo; LISTEN aaabar; UNLISTEN aaa%; ``` Should I: A. be unsubscribed from aaafoo and aaabar since both match aaa% or B. UNLISTEN should have no effect since I never subscribed to aaa%

Re: Allow LISTEN on patterns

2025-03-05 Thread Tom Lane
Trey Boudreau 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

Re: Allow LISTEN on patterns

2025-03-05 Thread Greg Sabino Mullane
Does not seem like a bug to me. Just the normal auto-lowercase encountered in every other SQL command. See: greg=# select * from pg_listening_channels(); pg_listening_channels --- (0 rows) greg=# listen foo; LISTEN greg=# select * from pg_listening_channels(); pg_listening_c

Re: Allow LISTEN on patterns

2025-03-05 Thread Trey Boudreau
> On Mar 5, 2025, at 10:42 AM, Tom Lane wrote: > > Anyway, I encourage reading some of the past threads on this > topic. > 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 N

Re: Allow LISTEN on patterns

2025-03-05 Thread Tom Lane
Aleksander Alekseev writes: > For instance, if I do: > ``` > LISTEN aaafoo; > LISTEN aaabar; > UNLISTEN aaa%; > ``` > Should I: > A. be unsubscribed from aaafoo and aaabar since both match aaa% or > B. UNLISTEN should have no effect since I never subscribed to aaa% explicitly? Yeah, the whole

Re: Allow LISTEN on patterns

2025-03-05 Thread Aleksander Alekseev
Hi, > I implemented a LISTEN command that supports matching names in the LIKE > format. The overall idea seems reasonable. It would be nice to have such a feature as long as it doesn't affect the performance of the existing applications. I think we should discuss particular semantics though. For

Re: Allow LISTEN on patterns

2025-03-04 Thread Trey Boudreau
> On Mar 3, 2025, at 10:39 PM, Quan Zongliang wrote: > > I implemented a LISTEN command that supports matching names in the LIKE > format. > > Just like > > LISTEN 'c%'; > NOTIFY c1;NOTIFY c2; > > Notifications are received for c1 and c2. > The parser down-cases ColId. Thus: LISTEN MiXeD

Allow LISTEN on patterns

2025-03-03 Thread Quan Zongliang
I implemented a LISTEN command that supports matching names in the LIKE format. Just like LISTEN 'c%'; NOTIFY c1;NOTIFY c2; Notifications are received for c1 and c2. For grammatical reasons, LISTEN 'v_'; with LISTEN v_; It's weird. Should it be defined in a way that makes it easier to distin

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-09-06 Thread Tom Lane
Alexander Cheshev writes: > [ v4-0001-Support-wildcards-in-LISTEN-command.patch ] I had not been paying much if any attention to this thread. I assumed from the title that it had in mind to allow something like LISTEN "foo%bar"; where the parameter would be interpreted similarly to a LIKE

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-28 Thread Alexander Cheshev
he patch) then we have a generalisation of the above command. For example, >>> UNLISTEN a* cancels registration on all channels which start with a. >>> >>> I attached to the email the new version of the patch which supports the >>> requested feature. Instead of >

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-21 Thread Emanuel Calvo
avior, and I'm not sure if this is >>> expected. >>> This command I assume should free all the listening channels, however, >>> it doesn't >>> seem to do so: >> >> >> TODO “Allow LISTEN on patterns” [1] is a bit vague about tha

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-15 Thread Alexander Cheshev
Emanuel, > > I did a test over the "UNLISTEN >" behavior, and I'm not sure if this is >> expected. >> This command I assume should free all the listening channels, however, it >> doesn't >> seem to do so: > > > TODO “Allow LISTEN on patterns

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-13 Thread Alexander Cheshev
Hi Emanuel, I did a test over the "UNLISTEN >" behavior, and I'm not sure if this is > expected. > This command I assume should free all the listening channels, however, it > doesn't > seem to do so: TODO “Allow LISTEN on patterns” [1] is a bit vague about tha

Re: [PATCH] TODO “Allow LISTEN on patterns”

2024-07-09 Thread Emanuel Calvo
Hello there, El vie, 15 mar 2024 a las 9:01, Alexander Cheshev () escribió: > Hello Hackers, > > I have implemented TODO “Allow LISTEN on patterns” [1] and attached > the patch to the email. The patch basically consists of the following > two parts. > > 1. Support wildca