Re: data to json enhancements - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: data to json enhancements
Date
Msg-id 5065A011.2020909@dunslane.net
Whole thread Raw
In response to Re: data to json enhancements  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: data to json enhancements  (Misa Simic <misa.simic@gmail.com>)
List pgsql-hackers
On 09/28/2012 08:22 AM, Peter Eisentraut wrote:
>> (3) Invent an auxiliary type along the lines of "json_value" and say
>> that you create a cast from foo to json_value when you want one
>> interpretation, or directly to json if you want the other.  Then
>> things like record_to_json would look for the appropriate type of cast.
>> This is a bit ugly because the auxiliary type has no reason to live
>> other than to separate the two kinds of cast, but it avoids creating
>> any new JSON-specific mechanisms in the type system.
> What if some wanted to create a yaml type as an extension.  How would
> they associate yaml and yaml_value?

Well, of course it wouldn't be a problem if the code could know the OID 
of yaml_value ... :-)

cheers

andrew




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: data to json enhancements
Next
From: Amit Kapila
Date:
Subject: Re: Switching timeline over streaming replication