Re: JSON for PG 9.2

Поиск
Список
Период
Сортировка
От Abhijit Menon-Sen
Тема Re: JSON for PG 9.2
Дата
Msg-id 20120202145126.GA5221@toroid.org
обсуждение исходный текст
Ответ на Re: JSON for PG 9.2  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
At 2012-02-02 08:54:32 -0500, robertmhaas@gmail.com wrote:
>
> Someone is eventually going to propose a function with a  name like
> json_to_string() which, when given this JSON object, returns a
> three-character string with the PostgreSQL text type.

Ah, that's the bit I was missing. I thought you were talking about an
immediate error condition.

> That's useful and I support it.

Agreed. Also, now I understand that you are saying that json_to_string()
(json_string_to_text?) would fail if the result couldn't be represented
as a text in the current encoding, and that's sensible as well. I had
misunderstood "is going to admit of a number of error…" in your mail.

As for surrogate pairs, just to be clear, what I was proposing earlier
in the thread was to change json.c:json_lex_string() to detect errors
(e.g. only one half of a surrogate pair, which is the commonest error
I've encountered in the wild) and reject such strings.

Thanks for the explanation.

-- ams


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: patch for implementing SPI_gettypemod()
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: keywords in initdb are case-sensitive?