Re: JSON output functions. - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: JSON output functions.
Date
Msg-id 4F2EDEE4.1050206@dunslane.net
Whole thread Raw
In response to Re: JSON output functions.  (Stefan Keller <sfkeller@gmail.com>)
List pgsql-hackers

On 02/05/2012 02:31 PM, Stefan Keller wrote:
> Hi Andrew
>
> Nice work!
>
> Just for completeness: Did you also think of including geometry types
> in JSON output functions in later releases? There's a nice extension
> of JSON called GeoJSON for a starting point.


[side note: please don't top-reply on -hackers. See 
<http://idallen.com/topposting.html>]

Currently, in array_to_json and row_to_json the only special cases are:
 * record types are output as JSON records * array types are output as JSON arrays * numeric types are output without
quoting* boolean types are output as unquoted true or false * NULLs are output as NULL
 


Everything else is output as its text representation, suitably quoted 
and escaped.

If you want to change how those operate, now rather than later would be 
the best time. But later we could certainly add various other 
foo_to_json functions for things like geometry types and hstores.

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: initdb and fsync
Next
From: Kohei KaiGai
Date:
Subject: Re: pgsql_fdw, FDW for PostgreSQL server