data to json enhancements - Mailing list pgsql-hackers

From Andrew Dunstan
Subject data to json enhancements
Date
Msg-id 50632EE0.5010008@dunslane.net
Whole thread Raw
Responses Re: data to json enhancements  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: autovacuum stress-testing our system
Next
From: Jeff Janes
Date:
Subject: Re: autovacuum stress-testing our system