Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmMLz-0007Z9-Rv for pgsql-sql@arkaria.postgresql.org; Tue, 20 Sep 2016 14:48:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bmMLz-0000y4-Ep for pgsql-sql@arkaria.postgresql.org; Tue, 20 Sep 2016 14:48:59 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bmML0-0007rr-MP for pgsql-sql@postgresql.org; Tue, 20 Sep 2016 14:47:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bmMKx-00081b-Vy for pgsql-sql@postgresql.org; Tue, 20 Sep 2016 14:47:57 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8KElo0i005847; Tue, 20 Sep 2016 10:47:50 -0400 From: Tom Lane To: "David G. Johnston" cc: =?UTF-8?B?0JDQvdC00YDQtdC5INCQ0LLQsNC60LjQvNC+0LI=?= , "pgsql-sql@postgresql.org" Subject: Re: PostgreSQL 9.5 operator precedence In-reply-to: References: <1474351364.271814.29325.2780@mail.rambler.ru> Comments: In-reply-to "David G. Johnston" message dated "Tue, 20 Sep 2016 07:10:58 -0700" Date: Tue, 20 Sep 2016 10:47:50 -0400 Message-ID: <20513.1474382870@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org "David G. Johnston" writes: > On Mon, Sep 19, 2016 at 11:02 PM, Андрей Авакимов >> 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