Re: Precedence of NOT LIKE, NOT BETWEEN, etc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Precedence of NOT LIKE, NOT BETWEEN, etc
Date: 2015-02-24 22:08:20
Message-ID: 17121.1424815700@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On 2/23/15 3:08 PM, Tom Lane wrote:
>> I thought of another possibility:
>>
>> 3. Leave everything as-is but mark the NOT-operator productions as having
>> the precedence of NOT rather than of LIKE etc. This would change the
>> behavior only for the NOT-LIKE-followed-by-< example, and would make the
>> two cases for NOT LIKE consistent though they'd remain inconsistent with
>> LIKE. This behavior seems at least somewhat explainable/documentable
>> ("NOT-foo operators have the precedence of NOT"), whereas what we have
>> seems about impossible to justify.

> I don't like this third option. If we're going to change anything, it
> should be changed so that LIKE and NOT LIKE have the same precedence.

Yeah, I concur. Working on patch to make that happen via token lookahead.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-02-24 22:12:19 Re: PostgreSQL on z/OS UNIX?
Previous Message Ratay, Steve 2015-02-24 22:06:38 Unable to build pg_rewind