Re: json(b) equality rules

From: Oleg Bartunov <obartunov(at)gmail(dot)com>
To: Yeb Havinga <yebhavinga(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json(b) equality rules
Date: 2014-04-03 09:02:21
Message-ID: CAF4Au4z-gx7_wWj25e9+9ipoPCOhXU0_npOeaNV6qOLV9CueDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Well, we don't supported Infinity and NaN in json(b), as well as Json
standard :)
Now we need a script, which generated nice html table.

On Thu, Apr 3, 2014 at 12:40 PM, Yeb Havinga <yebhavinga(at)gmail(dot)com> wrote:
> On 2014-04-03 09:40, Oleg Bartunov wrote:
>>
>> Sure, we don't follow. I mean should we add to documentation
>> such matrices.
>>
>> Oleg
>>
>> On Thu, Apr 3, 2014 at 11:32 AM, Oleg Bartunov <obartunov(at)gmail(dot)com>
>> wrote:
>>>
>>> Hi there,
>>>
>>> I'm wondering if we should follow all js equility rules as
>>> nicely visualized in
>>>
>>> http://strilanc.com/visualization/2014/03/27/Better-JS-Equality-Table.html
>>>
>>> Oleg
>
>
>
> +1
>
> I was a bit curious what the result would be. A quick inspection of the
> query results below gave the impression that the matrix would probably show
> a diagonal line. Even though the table is not necessary as a reference to
> strange equality rules, a table of equality showing a diagonal will be easy
> to remember.
>
> regards,
> Yeb
>
> drop table testjsonb;
> create table testjsonb(a jsonb);
> insert into testjsonb (a) values ('true');
> insert into testjsonb (a) values ('false');
> insert into testjsonb (a) values ('1');
> insert into testjsonb (a) values ('0');
> insert into testjsonb (a) values ('-1');
> insert into testjsonb (a) values ('"true"');
> insert into testjsonb (a) values ('"false"');
> insert into testjsonb (a) values ('"1"');
> insert into testjsonb (a) values ('"0"');
> insert into testjsonb (a) values ('""');
> insert into testjsonb (a) values ('null');
> insert into testjsonb (a) values ('undefined');
> insert into testjsonb (a) values ('Infinity');
> insert into testjsonb (a) values ('-Infinity');
> insert into testjsonb (a) values ('[]');
> insert into testjsonb (a) values ('{}');
> insert into testjsonb (a) values ('[{}]');
> insert into testjsonb (a) values ('[0]');
> insert into testjsonb (a) values ('[1]');
> insert into testjsonb (a) values ('NaN');
>
> select a.a, b.a, a.a = b.a
> from testjsonb a, testjsonb b
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-04-03 09:09:35 Re: Doing better at HINTing an appropriate column within errorMissingColumn()
Previous Message Yeb Havinga 2014-04-03 08:40:44 Re: json(b) equality rules