data to json enhancements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: data to json enhancements
Date: 2012-09-26 16:35:44
Message-ID: 50632EE0.5010008@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Drawing together various discussions both here and elsewhere (e.g. the
PostgresOpen hallway track) I propose to work on the following:

1. make datum_to_json() honor a type's cast to json if it exists. The
fallback is to use the type's string representation, as now.
2. add a cast hstore -> json (any others needed for core / contrib types ?)
3. add a to_json(anyelement) function
4. add a new aggregate function json_agg(anyrecord) -> json to simplify
and make more effecient turning a resultset into json.

Comments welcome.

I also propose to work on some accessor functions to pull data out of
json (as opposed to producing json from non-json). I will email
separately about that when I have firmed up a proposed API a bit more.

cheers

andrew

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2012-09-26 17:18:51 Re: autovacuum stress-testing our system
Previous Message Tom Lane 2012-09-26 16:29:17 Re: autovacuum stress-testing our system