From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Trey Boudreau <trey(at)treysoft(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Discussion on a LISTEN-ALL syntax |
Date: | 2024-12-20 21:49:11 |
Message-ID: | CAKFQuwYvRZPK=qpbHTpLWWLQU5DRxv16Mm7yZUk3VAkECLnAwA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Dec 20, 2024 at 2:42 PM Trey Boudreau <trey(at)treysoft(dot)com> wrote:
>
> > On Dec 20, 2024, at 2:58 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Seems reasonable in the abstract, and given the UNLISTEN * precedent
> > it's hard to quibble with that syntax choice. I think what actually
> > needs discussing are the semantics, specifically how this'd interact
> > with other LISTEN/UNLISTEN actions.
>
> My first pass at the documentation looks like this:
>
> <para>
> The special wildcard <literal>*</literal> cancels all listener
> registrations for the current session and replaces them with a
> virtual registration that matches all channels. Further
> <command>LISTEN</command> and <command>UNLISTEN <replaceable
> class="parameter">channel</replaceable></command> commands will
> be ignored until the session sees the <command>UNLISTEN *</command>
> command.
> </para>
>
I just sent my thoughts here as well. The choice to "cancel all listener
registrations" seems unintuitive and unnecessary - so long as we either
document or handle deduplication internally.
As I noted in my email, * is a permit-all policy in a "deny by default"
system. Such a system is allowed to have other more targeted "allow"
policies existing at the same time. If the permit-all policy gets removed
then those individual allow policies immediately become useful again. If
you want to remove those targeted allowed policies execute Unlisten *
before executing Listen *.
I dislike the non-symmetric meaning of * in the command sequence above but
it likely is better than inventing a whole new syntax.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2024-12-20 21:57:34 | Re: Discussion on a LISTEN-ALL syntax |
Previous Message | David G. Johnston | 2024-12-20 21:42:38 | Re: Discussion on a LISTEN-ALL syntax |