Обсуждение: BUG #13892: SELECT FALSE = FALSE = TRUE; error

Поиск
Список
Период
Сортировка

BUG #13892: SELECT FALSE = FALSE = TRUE; error

От
fotonszekta@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      13892
Logged by:          Gábor Szabó
Email address:      fotonszekta@gmail.com
PostgreSQL version: 9.5.0
Operating system:   Windows 10 x64
Description:

I read a post on "SELECT FALSE = FALSE = TRUE;"
(http://databaseblog.myname.nl/2016/01/when-simple-sql-can-be-complex.html)

I tried on 9.5, and it's throws an error:
ERROR: syntax error at or near "="
LINE 1: SELECT FALSE = FALSE = TRUE;
                             ^
(the error is at the second '=')

It's maybe related to "Adjust operator precedence to match the SQL
standard"

9.1 and 9.4 returns true as excepted

Re: BUG #13892: SELECT FALSE = FALSE = TRUE; error

От
Tom Lane
Дата:
fotonszekta@gmail.com writes:
> I tried on 9.5, and it's throws an error:
> ERROR: syntax error at or near "="
> LINE 1: SELECT FALSE = FALSE = TRUE;
>                              ^
> (the error is at the second '=')

> It's maybe related to "Adjust operator precedence to match the SQL
> standard"

Yes, that's an intentional change.  If you actually intend this
and it's not just a typo, add parentheses.

            regards, tom lane