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

From Alexander Korotkov
Subject Re: jsonb contains behaviour weirdness
Date
Msg-id CAPpHfdvHc-Dht6i3hSgYYsJAM3GbT0j1xK8Cg3tQ4UXFEKzw6A@mail.gmail.com
Whole thread Raw
In response to Re: jsonb contains behaviour weirdness  (Peter Geoghegan <pg@heroku.com>)
List pgsql-hackers
On Fri, Sep 12, 2014 at 10:38 PM, Peter Geoghegan <pg@heroku.com> wrote:
On Fri, Sep 12, 2014 at 11:21 AM, Josh Berkus <josh@agliodbs.com> wrote:
>> # select '[1,1,2]'::jsonb @> '[1,2,2]'::jsonb;
>>  ?column?
>> ----------
>>  t
>> (1 row)
>>
>> But, it's not. Jsonb contains takes care only about length of array.
>
> OK, now, that's messed up.

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.

Agree. I just tried to explain how current behaviour could look for user who sees it for the first time.

------
With best regards,
Alexander Korotkov.  

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Next
From: Andres Freund
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes