Skip site navigation (1) Skip section navigation (2)

Re: data to json enhancements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: data to json enhancements
Date: 2012-09-28 13:03:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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 ... :-)



In response to


pgsql-hackers by date

Next:From: Amit KapilaDate: 2012-09-28 13:08:26
Subject: Re: Switching timeline over streaming replication
Previous:From: Peter EisentrautDate: 2012-09-28 12:22:51
Subject: Re: data to json enhancements

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group