Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON - Mailing list pgsql-hackers

From Joey Adams
Subject Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON
Date
Msg-id CAARyMpDKzqj1dq3mfb3uBoMV4m3suNvxGrXYzEA+FmwoHwxM3w@mail.gmail.com
Whole thread Raw
In response to Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON
List pgsql-hackers
On Wed, Jul 20, 2011 at 12:32 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>> Thanks for the input.  I'm leaning in this direction too.  However, it
>> will be a tad tricky to implement the conversions efficiently, ...
>
> I'm a bit confused, because I thought what I was talking about was not
> doing any conversions in the first place.

We want to be able to handle \uXXXX escapes when the database encoding
is not UTF-8.  We could leave them in place, but sooner or later
they'll need to be converted in order to unwrap or compare JSON
strings.

The approach being discussed is converting escapes to the database
encoding.  This means escapes of characters not available in the
database encoding (e.g. \u266B in ISO-8859-1) will be forbidden.

The PostgreSQL parser (which also supports Unicode escapes) takes a
simpler approach: don't allow non-ASCII escapes unless the server
encoding is UTF-8.

- Joey


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Initial Review: JSON contrib modul was: Re: Another swing at JSON
Next
From: Yeb Havinga
Date:
Subject: Re: [v9.2] Fix leaky-view problem, part 2