Re: Precedence of standard comparison operators

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Precedence of standard comparison operators
Date: 2015-02-20 20:12:18
Message-ID: 54E79522.1000105@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2/20/15 2:41 PM, Tom Lane wrote:
> I don't believe there is any practical way for us to generate useful
> warnings here; as I said to Kevin, I don't think that Bison exposes
> sufficient information to detect when a parsing decision was made
> differently than before because of precedence.

We could check if there is a >= or <= as a child of another general
operator. That is already quite unlikely to begin with (except for the
obvious common case I am forgetting right now). We could even do this
in an external module with a hook. Or to be more precise, check whether
the >= or <= was in parentheses, which we could record in the parser.
Neither might be absolutely accurate, but it would at least give users a
list of things to check.

The above would imply that we add these checks before changing the
precedence. Creating a check under the new precendence would be much
harder.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-02-20 20:23:24 Re: Combining Aggregates
Previous Message Tomas Vondra 2015-02-20 20:09:49 Re: Combining Aggregates