Re: jsonb and nested hstore

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Peter Geoghegan <pg(at)heroku(dot)com>, Oleg Bartunov <obartunov(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: jsonb and nested hstore
Date: 2014-03-04 15:10:19
Message-ID: 5315ECDB.90803@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> huh. what it is the standard for equivalence? I guess we'd be
> following javascript ===, right?
> (http://dorey.github.io/JavaScript-Equality-Table/).

right.

But in your link I don't understand array (and object) equality rules. Hstore
(and jsonb) compare function believes that arrays are equal if each
corresponding elements of them are equal.

postgres=# select 'a=>[]'::hstore = 'a=>[]'::hstore;
?column?
----------
t
(1 row)

Time: 0,576 ms
postgres=# select 'a=>[0]'::hstore = 'a=>[0]'::hstore;
?column?
----------
t
(1 row)

Time: 0,663 ms
postgres=# select 'a=>[0]'::hstore = 'a=>[1]'::hstore;
?column?
----------
f

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-03-04 15:17:52 Re: ALTER TABLE lock strength reduction patch is unsafe
Previous Message Noah Misch 2014-03-04 15:09:27 Re: Securing "make check" (CVE-2014-0067)