json casts

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема json casts
Дата
Msg-id 5384ED51.9090704@dunslane.net
обсуждение исходный текст
Ответы Re: json casts
Список pgsql-hackers
I've been on the receiving end of a couple of mumbles about the fact 
that the JSON rendering code ignores casts of builtin types to JSON. 
This was originally done as an optimization to avoid doing cache lookups 
for casts for things we knew quite well how to turn into JSON values 
(unlike, say, hstore). However, there is at least one concrete case 
where this has some possibly undesirable consequences, namely 
timestamps. Many JSON processors, especially JavaScript/ECMAScript 
processors, require timestamp values to be in ISO 8601 format, with a 
'T' between the date part and the time part, and thus they barf on the 
output we produce for such values.

I'm therefore wondering if we should just remove this optimization. I 
don't have any performance figures, but it seems unlikely to be terribly 
expensive. Perhaps in 9.5 we should look at caching a lot of the info 
the json rendering code gathers, but that's something we can't look at now.

cheers

andrew



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

Предыдущее
От: Evan Jones
Дата:
Сообщение: Re: PG Manual: Clarifying the repeatable read isolation example
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: json casts