Re: Named Operators

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Gurjeet Singh <gurjeet(at)singh(dot)im>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Named Operators
Date: 2023-01-12 15:21:57
Message-ID: CAKFQuwZcsyjN5W1wJRU3yOMhn=RvWZVMAQ3-d6L2eLWZiBAr7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 12, 2023 at 3:59 AM Gurjeet Singh <gurjeet(at)singh(dot)im> wrote:

> On Thu, Jan 12, 2023 at 1:49 AM Matthias van de Meent
> <boekewurm+postgres(at)gmail(dot)com> wrote:
>
> > I'm -1 on the chosen syntax; :name: shadows common variable
> > substitution patterns including those of psql.
>
> I'll consider using one of the other special characters. Do you have
> any suggestions?
>
>
The R language uses %...% to denote custom operators.

That would be a bit annoying for dynamic SQL using format though...

Do we have to choose? There are 15 allowed characters for operator names
presently (aside from + and -), could we define the rule that an operator
name can contain any sequence of alphabetic+underscore+space? characters so
long as the first and last symbol of the operator name is one of those 15
characters?

Another appealing option would be the non-matching but complementary pair
<...> (I'd consider removing these from the 15 choices in we go that route)

SELECT 1 <add> 2;

I would probably avoid requiring back-ticks given their usage as identifier
quoting in other systems - probably remove it from the 15 choices if we go
that route.

David J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dag Lem 2023-01-12 15:30:39 Re: daitch_mokotoff module
Previous Message Tom Lane 2023-01-12 15:21:36 Re: Named Operators