Re: [PATCH] Pattern based listeners for asynchronous messaging (LISTEN/NOTIFY)

From: Markus Sintonen <markus(dot)sintonen(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: [PATCH] Pattern based listeners for asynchronous messaging (LISTEN/NOTIFY)
Date: 2017-08-01 05:06:52
Message-ID: CAMpj9JZzZ83Te81mL3+HY-U2rwMp3AQQjZ4M9=H2SOsETuthxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following does not work:
LISTEN 'foo%'
Neither this:
LISTEN SIMILAR TO "foo%"
This works:
LISTEN "foo%"
But it does not act as a pattern.

We could change the SIMILAR TO something like following (accepting also
type of the pattern), for example:
LISTEN PATTERN 'foo%' TYPE 'similar'
LISTEN PATTERN 'foo*' TYPE 'ltree'
Or
LISTEN PATTERN 'foo%' USING 'similar'
Or
LISTEN MATCH 'foo%' USING 'similar'
Or
LISTEN MATCH 'foo%' TYPE 'similar'

Documentation is coming up.

2017-07-31 23:30 GMT+03:00 Peter Eisentraut <
peter(dot)eisentraut(at)2ndquadrant(dot)com>:

> On 7/31/17 16:13, Markus Sintonen wrote:
> > This patch has no know backward compatibility issues with the existing
> > /LISTEN///UNLISTEN/ features. This is because patch extends the existing
> > syntax by accepting quoted strings which define the patterns as opposed
> > to the existing SQL literals.
>
> I don't see that in the patch. Your patch changes the syntax LISTEN
> ColId to mean a regular expression.
>
> Even then, having LISTEN "foo" and LISTEN 'foo' mean different things
> would probably be confusing.
>
> I would think about specifying an operator somewhere in the syntax, like
> you have with LISTEN SIMILAR TO. It would even be nice if a
> non-built-in operator could be used for matching names.
>
> Documentation is missing in the patch.
>
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Shay Rojansky 2017-08-01 05:23:57 Re: PostgreSQL not setting OpenSSL session id context?
Previous Message Noah Misch 2017-08-01 05:06:11 Re: Freeze on Cygwin w/ concurrency