Re: Precedence of standard comparison operators

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Precedence of standard comparison operators
Дата
Msg-id 20150810033744.GD1900437@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: Precedence of standard comparison operators  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Precedence of standard comparison operators  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Sun, Aug 09, 2015 at 08:06:11PM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > 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.
> 
> Part of my thinking was that the 9.4 behavior fails the principle of least
> astonishment, because I seriously doubt that people expect '=' to be
> either right-associative or lower priority than '<'.  Here's one example:
> 
> regression=# select false = true < false;
>  ?column? 
> ----------
>  t
> (1 row)

> So yeah, I do think that getting a syntax error if you don't use
> parentheses is the preferable behavior here.

I agree.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: WIP: SCRAM authentication
Следующее
От: Satoshi Nagayasu
Дата:
Сообщение: Re: Assert in pg_stat_statements