Re: jsonb contains behaviour weirdness - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: jsonb contains behaviour weirdness
Date
Msg-id 54186FE0.40004@agliodbs.com
Whole thread Raw
In response to jsonb contains behaviour weirdness  (Alexander Korotkov <aekorotkov@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: jsonb format is pessimal for toast compression
Next
From: "Brightwell, Adam"
Date:
Subject: Re: Selectivity estimation for inet operators