Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Joey Adams <joeyadams3(dot)14159(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bernd Helmle <mailings(at)oopsware(dot)de>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, David Fetter <david(at)fetter(dot)org>, Josh Berkus <josh(at)agliodbs(dot)com>, Florian Pflug <fgp(at)phlo(dot)org>
Subject: Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON
Date: 2011-07-22 23:16:10
Message-ID: 4E2A04BA.7030408@wulczer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23/07/11 01:12, Robert Haas wrote:
> On Fri, Jul 22, 2011 at 6:04 PM, Joey Adams <joeyadams3(dot)14159(at)gmail(dot)com> wrote:
>> On another matter, should the JSON type guard against duplicate member
>> keys? The JSON RFC says "The names within an object SHOULD be
>> unique," meaning JSON with duplicate members can be considered valid.
>> JavaScript interpreters (the ones I tried), PHP, and Python all have
>> the same behavior: discard the first member in favor of the second.
>> That is, {"key":1,"key":2} becomes {"key":2}. The XML type throws an
>> error if a duplicate attribute is present (e.g. '<a href="b"
>> href="c"/>'::xml).
>
> Hmm. That's tricky. I lean mildly toward throwing an error as being
> more consistent with the general PG philosophy.

OTOH:

regression=# select 'key=>1,key=>2'::hstore;
hstore
------------
"key"=>"1"
(1 row)

Cheers,
Jan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-07-22 23:19:17 Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON
Previous Message Robert Haas 2011-07-22 23:12:48 Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON