Re: JSON for PG 9.2

Pavel Stehule <pavel.stehule@gmail.com>

From: Pavel Stehule <pavel.stehule@gmail.com>
To: Merlin Moncure <mmoncure@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>, Joey Adams <joeyadams3.14159@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "David E. Wheeler" <david@kineticode.com>, Claes Jakobsson <claes@surfar.nu>, Dimitri Fontaine <dimitri@2ndquadrant.fr>, Magnus Hagander <magnus@hagander.net>, Jan Urbański <wulczer@wulczer.org>, Simon Riggs <simon@2ndquadrant.com>, Bruce Momjian <bruce@momjian.us>, PostgreSQL-development Hackers <pgsql-hackers@postgresql.org>, Jan Wieck <janwieck@yahoo.com>
Date: 2012-01-12T16:25:39Z
Lists: pgsql-hackers
2012/1/12 Merlin Moncure <mmoncure@gmail.com>:
> On Thu, Jan 12, 2012 at 9:51 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
>> On 01/12/2012 10:44 AM, Pavel Stehule wrote:
>>> this should be little bit more enhanced to support a row arrays - it
>>> can be merged with some routines from pst tool
>>> http://okbob.blogspot.com/2010/11/new-version-of-pst-collection-is.html
>>
>> I will be covering composites.
>
> curious, will your function work on unregistered composites?  What
> would this do?
>
> select array_to_json(array[row('a', 1), row('b', 2)]);

it can do it - but it has to use some defaults for names.

Pavel

>
> merlin