Re: JSON for PG 9.2 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: JSON for PG 9.2
Date
Msg-id CA+TgmoZ2iA=ssFpJetw0UZoOew4SgjdJ-wocYM4YCrx7AtRZgg@mail.gmail.com
Whole thread Raw
In response to Re: JSON for PG 9.2  (Joey Adams <joeyadams3.14159@gmail.com>)
Responses Re: JSON for PG 9.2  (Abhijit Menon-Sen <ams@toroid.org>)
List pgsql-hackers
On Tue, Jan 31, 2012 at 3:47 PM, Joey Adams <joeyadams3.14159@gmail.com> wrote:
> I'm mostly in favor of allowing \u0000.  Banning \u0000 means users
> can't use JSON strings to marshal binary blobs, e.g. by escaping
> non-printable characters and only using U+0000..U+00FF.  Instead, they
> have to use base64 or similar.

I agree.  I mean, representing data using six bytes per source byte is
a bit unattractive from an efficiency point of view, but I'm sure
someone is going to want to do it.  It's also pretty clear that JSON
string -> PG text data type is going to admit of a number of error
conditions (transcoding errors and perhaps invalid surrogate pairs) so
throwing one more on the pile doesn't cost much.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: libpq: fix sslcompression leak
Next
From: Simon Riggs
Date:
Subject: Re: Should I implement DROP INDEX CONCURRENTLY?