agora inbox for pgsql-sql@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Андрей Авакимов <aquarius1993@rambler.ru>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: PostgreSQL 9.5 operator precedence
Date: Tue, 20 Sep 2016 10:47:50 -0400
Message-ID: <20513.1474382870@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwbY1c1iUZGLzi5430tZN9==ozM7bh3uUXDfcbZ3KcRWew@mail.gmail.com>
References: <1474351364.271814.29325.2780@mail.rambler.ru>
<CAKFQuwbY1c1iUZGLzi5430tZN9==ozM7bh3uUXDfcbZ3KcRWew@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>
"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
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
view thread (3+ messages)
Message-ID: <20513.1474382870@sss.pgh.pa.us>
Permalink: ../20513.1474382870@sss.pgh.pa.us/
Also on: postgresql.org/message-id/20513.1474382870@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, aquarius1993@rambler.ru
Subject: Re: PostgreSQL 9.5 operator precedence
In-Reply-To: <20513.1474382870@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox