Re: JSON output functions.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Stefan Keller <sfkeller(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, postgis-devel(at)postgis(dot)refractions(dot)net
Subject: Re: JSON output functions.
Date: 2012-02-05 19:56:20
Message-ID: 4F2EDEE4.1050206@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kohei KaiGai 2012-02-05 20:08:10 Re: pgsql_fdw, FDW for PostgreSQL server
Previous Message Tom Lane 2012-02-05 19:50:20 Re: initdb and fsync