"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Sep 19, 2016 at 11:02 PM, Андрей Авакимов <aquarius1993@rambler.ru>
>> The thing I don't understand is the error message that I receive:
>> select 1 is null = 2 is null;
>> -----------------------------
>> ERROR: operator does not exist: boolean = integer
>> LINE 1: select 1 is null = 2 is null
> Your query reads:
> SELECT ( ( 1 IS (NULL = 2) ) IS NULL
No, certainly not that --- IS isn't some sort of standalone operator,
rather IS NULL is an indivisible combination of tokens representing a
postfix operator. The query's really getting parsed like this:
select ((1 is null) = 2) is null;
whereas the pre-9.5 interpretation was
select (1 is null) = (2 is null);
If you add those parentheses explicitly then your query will work fine
in either version.
regards, tom lane