Re: 9.5 "chained equality" behavior

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Joshua Ma <josh(at)benchling(dot)com>
Cc: PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.5 "chained equality" behavior
Date: 2017-05-31 07:11:18
Message-ID: FACFED75-000C-4B1A-BAD5-129062A44178@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On 30 May 2017, at 22:56, Joshua Ma <josh(at)benchling(dot)com> wrote:
>
> Our team is upgrading from 9.4 to 9.5, and we noticed this behavior change:
>
> 9.4:
> # SELECT true = true = true;
> ?column?
> ----------
> t
> (1 row)

Does that really do what you intended though?

# select false = false = false;
?column?
----------
f
(1 row)

I suspect you expect that to result in 't', not 'f', so replacing that with AND would change the behaviour for false boolean values. (This is from 9.3, btw)

Perhaps explicitly adding the braces that pre-9.5 pg adds implicitly gets you what you had? I suspect that would work on 9.5 as well (but can't test right now).

# select false = (false = false);
?column?
----------
f
(1 row)

# select true = (true = true);
?column?
----------
t
(1 row)

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2017-05-31 07:46:35 Re: Slow query plan used
Previous Message Patrick B 2017-05-31 06:19:52 Re: Regexp + spaces PG 9.1