Re: Duplicate JSON Object Keys - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: Duplicate JSON Object Keys
Date
Msg-id 46479E46-F635-44BB-8B44-1357F623F1A8@justatheory.com
Whole thread Raw
In response to Re: Duplicate JSON Object Keys  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Mar 8, 2013, at 1:01 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:

>> If it does not meet these "semantic" constraints, then it is not
>> really JSON - it is merely JSON-like.
>>
>> this sounds very much like MySQLs decision to support timestamp
>> "0000-00-00 00:00" - syntactically correct, but semantically wrong.
>
> Is it wrong?  The standard cited says SHOULD, not MUST.

Yes, it is wrong, because multiple keys are specifically disallowed for accessing values. Hence this new error:
  david=# select json_get('{"foo": 1, "foo": 2}', 'foo');  ERROR:  field name is not unique in json object

I really don’t think that should be possible.

Best,

David


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Duplicate JSON Object Keys
Next
From: Gavin Flower
Date:
Subject: Re: Duplicate JSON Object Keys