Re: jsonb contains behaviour weirdness

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb contains behaviour weirdness
Date: 2014-09-16 17:14:08
Message-ID: 54186FE0.40004@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/15/2014 11:12 AM, Tom Lane wrote:
>> Or are you proposing that JSONARRAY @> JSONARRAY should work differently
>> from ARRAY @> ARRAY?
>
> And no. It's a bug that jsonb array containment works differently from
> regular array containment. We understand the source of the bug, ie a
> mistaken optimization. I don't see why there's much need for discussion
> about anything except whether removing the optimization altogether
> (as Peter proposed) is the best fix, or whether we want to retain
> some weaker form of it.

Right, so I was just saying that after we fix this behavior, the
behavior of JSONARRAY @> JSONARRAY should be commented somewhere because
that comparison may not work the way users who are not long-time
postgres users expect. Heck, I've personally done very little ARRAY @>
ARRAY myself in 12 years of using PostgreSQL arrays; I had to test it to
verify the current behavior.

Not sure exactly where this note should go, mind you.

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Brightwell, Adam 2014-09-16 17:14:16 Re: Selectivity estimation for inet operators
Previous Message Josh Berkus 2014-09-16 17:11:47 Re: jsonb format is pessimal for toast compression