Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?
Дата
Msg-id 1336209194.13755.10.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On fre, 2012-05-04 at 12:30 -0400, Andrew Dunstan wrote:
> Yeah, what I've been thinking about in conjunction with similar
> problems is some sort of type registry, so that we could code for
> non-builtin types in certain cases.

It certainly seems to come up a lot, but I'm not sure whether the two
main use cases -- mapping types into languages, and mapping types into
JSON (or XML, as an alternative) -- would have the same solution.  A
third use case that could be included as well is changing the main text
or binary format of a type (e.g., what datestyle does).  So instead of
having just a hard-coded set of typinput/typoutput, typrecv/typsend,
you'd have a catalog of

(context, inputfunc, outputfunc)

and the context would a language, something json or xml, or a
user-settable value.  This could become quite complicated, but it sure
could solve a lot of issues in one go.




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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?