Re: Proposal: Add JSON support

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: Add JSON support
Date: 2010-03-28 23:22:31
Message-ID: 4BAFE4B7.504@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Robert Haas wrote:
>>
>>> I think you need to assume that the encoding will be the server
>>> encoding, not UTF-8. Although others on this list are better
>>> qualified to speak to that than I am.
>>>
>
>
>> The trouble is that JSON is defined to be specifically Unicode, and in
>> practice for us that means UTF8 on the server side. It could get a bit
>> hairy, and it's definitely not something I think you can wave away with
>> a simple "I'll just throw some encoding/decoding function calls at it."
>>
>
> It's just text, no? Are there any operations where this actually makes
> a difference?
>

If we're going to provide operations on it that might involve some. I
don't know.
> Like Robert, I'm *very* wary of trying to introduce any text storage
> into the backend that is in an encoding different from server_encoding.
> Even the best-case scenarios for that will involve multiple new places for
> encoding conversion failures to happen.
>
>

I agree entirely. All I'm suggesting is that there could be many
wrinkles here.

Here's another thought. Given that JSON is actually specified to consist
of a string of Unicode characters, what will we deliver to the client
where the client encoding is, say Latin1? Will it actually be a legal
JSON byte stream?

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-03-28 23:36:10 Re: Proposal: Add JSON support
Previous Message Robert Haas 2010-03-28 23:22:28 Re: Alpha release this week?