Re: 9.5 "chained equality" behavior - Mailing list pgsql-general

From Alban Hertroys
Subject Re: 9.5 "chained equality" behavior
Date
Msg-id FACFED75-000C-4B1A-BAD5-129062A44178@gmail.com
Whole thread Raw
In response to [GENERAL] 9.5 "chained equality" behavior  (Joshua Ma <josh@benchling.com>)
List pgsql-general
> On 30 May 2017, at 22:56, Joshua Ma <josh@benchling.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
booleanvalues. (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
on9.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.



pgsql-general by date:

Previous
From: Patrick B
Date:
Subject: Re: [GENERAL] Regexp + spaces PG 9.1
Next
From: Andreas Kretschmer
Date:
Subject: Re: [GENERAL] Slow query plan used