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

Поиск
Список
Период
Сортировка
От Hannu Krosing
Тема Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?
Дата
Msg-id 1336160694.19151.85.camel@hvost
обсуждение исходный текст
Ответ на Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, 2012-05-04 at 13:43 -0400, Robert Haas wrote:
> On Fri, May 4, 2012 at 12:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Andrew Dunstan <andrew@dunslane.net> writes:
> >> 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. Maybe we should add that the the developers'
> >> meeting agenda.
> >
> > Maybe.  I don't want to see a json-specific hack for this, but some sort
> > of generic way to add type knowledge could be useful, if we could figure
> > out what we want.
> 
> For this particular case, I think you just need some place to store a
> pg_type -> pg_proc mapping.  I'm not exactly sure how to make that not
> a JSON-specific hack, since I certainly don't think we'd want to add a
> new catalog just for that.

This was my initial proposal to have casts to ::json for all types.

I backed out from this in favot of generic to_json(datum, indent) in
order to support prettyprinting.

> -- 
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
> 




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

Предыдущее
От: Jan Urbański
Дата:
Сообщение: Re: PL/Python result set slicing broken in Python 3
Следующее
От: Hannu Krosing
Дата:
Сообщение: Re: JSON in 9.2 - Could we have just one to_json() function instead of two separate versions ?