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

From Noah Misch
Subject Re: Precedence of standard comparison operators
Date
Msg-id 20150809233631.GC1900437@tornado.leadboat.com
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  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sun, Aug 09, 2015 at 07:16:02PM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Sun, Aug 09, 2015 at 06:44:58PM -0400, Tom Lane wrote:
> >> So for our
> >> purposes, it's better to keep BETWEEN and friends as binding slightly
> >> tighter than '<' than to make them the same precedence.  Same precedence
> >> risks breaking things that weren't broken before.
> 
> > It does risk that.  Same deal with making "=" have the same precedence as "<"
> > instead of keeping it slightly lower.
> 
> Agreed, but in that case I think our hand is forced by the SQL standard.

In SQL:2008 and SQL:2011 at least, "=", "<" and "BETWEEN" are all in the same
boat.  They have no precedence relationships to each other; SQL sidesteps the
question by requiring parentheses.  They share a set of precedence
relationships to other constructs.  SQL does not imply whether to put them in
one %nonassoc precedence group or in a few, but we can contemplate whether
users prefer an error or prefer the 9.4 behavior for affected queries.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Precedence of standard comparison operators
Next
From: "Daniel Verite"
Date:
Subject: Re: [patch] A \pivot command for psql