Re: jsonb contains behaviour weirdness

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Peter Geoghegan <pg(at)heroku(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb contains behaviour weirdness
Date: 2014-09-12 19:15:10
Message-ID: 5413463E.90901@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2014-09-12 19:17:03 Re: pgcrypto: PGP signatures
Previous Message Andreas 'ads' Scherbaum 2014-09-12 19:13:35 Re: documentation update for doc/src/sgml/func.sgml