Re: Precedence of standard comparison operators - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Precedence of standard comparison operators
Date
Msg-id 18810.1439156146@sss.pgh.pa.us
Whole thread Raw
In response to Re: Precedence of standard comparison operators  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Noah Misch <noah@leadboat.com> writes:
>> Why in particular the following three precedence groups instead of
>> combining them as in SQL or subdividing further as in PostgreSQL 9.4?

> +%nonassoc    '<' '>' '=' LESS_EQUALS GREATER_EQUALS NOT_EQUALS
> +%nonassoc    BETWEEN IN_P LIKE ILIKE SIMILAR NOT_LA
> %nonassoc    OVERLAPS

> OVERLAPS is a special case in that it doesn't really need precedence at
> all: both its arguments are required to be parenthesized.  We could
> possibly have removed it from the precedence hierarchy altogether, but
> I didn't bother experimenting with that, just left it alone.  But
> because of that, "moving BETWEEN/IN below it" doesn't really change
> anything.

I got off my rear and did the experiment, and found that indeed simply
removing "%nonassoc OVERLAPS" seems to work and not change any behavior
(in fact, the generated gram.c is identical).  Shall we do that and remove
the listing of OVERLAPS in the documentation's precedence table?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: WIP: SCRAM authentication
Next
From: Alexander Korotkov
Date:
Subject: WIP: Rework access method interface