Re: Oid registry

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Oid registry
Дата
Msg-id 565.1348610327@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Oid registry  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Oid registry  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On 9/24/12 10:26 PM, Andrew Dunstan wrote:
>> Well, an obvious case is how record_to_json handles fields. If it knows
>> nothing about the type all it can do is output the string value. That
>> doesn't work well for types such as hstore. If it could reliably
>> recognize a field as an hstore it might well be able to do lots better.

> I think the fix there is that the type supplies a "to JSON" function as
> part of its type definition (just like input and output functions).  "to
> XML" would also be useful.  Most types wouldn't need them and default to
> string output.

Yes ... but I really don't want to go down the path of treating those as
new type properties; it doesn't scale.  (And please don't tell me that
JSON is the last word in container types and there will never be
requests for any more of these.)

Can we define these functions as being the cast-from-foo-to-json and
cast-from-foo-to-xml functions?  That would let us use the existing cast
infrastructure to manage them.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Oid registry
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Oid registry