pgsql: JSON generation improvements.

Started by Andrew Dunstanover 13 years ago1 messagescomitters
Jump to latest
#1Andrew Dunstan
andrew@dunslane.net

JSON generation improvements.

This adds the following:

json_agg(anyrecord) -> json
to_json(any) -> json
hstore_to_json(hstore) -> json (also used as a cast)
hstore_to_json_loose(hstore) -> json

The last provides heuristic treatment of numbers and booleans.

Also, in json generation, if any non-builtin type has a cast to json,
that function is used instead of the type's output function.

Andrew Dunstan, reviewed by Steve Singer.

Catalog version bumped.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/38fb4d978c5bfc377ef979e2595e3472744a3b05

Modified Files
--------------
contrib/hstore/expected/hstore.out | 36 ++++
contrib/hstore/hstore--1.1.sql | 13 ++
contrib/hstore/hstore_io.c | 217 ++++++++++++++++++++++++
contrib/hstore/sql/hstore.sql | 12 ++
doc/src/sgml/func.sgml | 48 ++++++
doc/src/sgml/hstore.sgml | 23 +++
src/backend/utils/adt/json.c | 317 +++++++++++++++++++++++++++++++++---
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_aggregate.h | 3 +
src/include/catalog/pg_proc.h | 8 +
src/include/utils/json.h | 5 +
src/test/regress/expected/json.out | 24 +++
src/test/regress/sql/json.sql | 12 ++
13 files changed, 699 insertions(+), 21 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers