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

From Josh Berkus
Subject Re: jsonb contains behaviour weirdness
Date
Msg-id 5413463E.90901@agliodbs.com
Whole thread Raw
In response to jsonb contains behaviour weirdness  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: jsonb contains behaviour weirdness
List pgsql-hackers
On 09/12/2014 11:38 AM, Peter Geoghegan wrote:
> To be clear: I don't think that this example is messed up (in
> isolation). I think it's the correct behavior. What I find
> objectionable is the inconsistency. I believe that this is Alexander's
> concern too. Alexander's first example exhibits broken behavior.

Hmmm, oh.  Yeah, I see what you mean; PostgreSQL's SQL array behavior is
that @> is true if array A contains all of the elements of array B
regardless of ordering or repetition.

jsonic=# select array[1,2,2] @> array[1,1,2]

;?column?
----------t

That's consistent with our docs and past behavior.

However, this better become a FAQ item, because it's not necessarily the
behavior that folks used to JSON but not Postgres will expect.

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



pgsql-hackers by date:

Previous
From: Andreas 'ads' Scherbaum
Date:
Subject: Re: documentation update for doc/src/sgml/func.sgml
Next
From: Jeff Janes
Date:
Subject: Re: pgcrypto: PGP signatures