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

From Peter Eisentraut
Subject Re: Precedence of standard comparison operators
Date
Msg-id 54E79522.1000105@gmx.net
Whole thread Raw
In response to Re: Precedence of standard comparison operators  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Precedence of standard comparison operators
List 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.



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Combining Aggregates
Next
From: Peter Eisentraut
Date:
Subject: Re: Combining Aggregates