JSON generation improvements.
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 10 Mar 2013 21:35:36 +0000 (17:35 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 10 Mar 2013 21:35:36 +0000 (17:35 -0400)
commit38fb4d978c5bfc377ef979e2595e3472744a3b05
treeaf34c36f949f83c6527921cdbac1892c22719ac5
parentdd28c410f77e415ce104cb42bf52c4a5457085da
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.
13 files changed:
contrib/hstore/expected/hstore.out
contrib/hstore/hstore--1.1.sql
contrib/hstore/hstore_io.c
contrib/hstore/sql/hstore.sql
doc/src/sgml/func.sgml
doc/src/sgml/hstore.sgml
src/backend/utils/adt/json.c
src/include/catalog/catversion.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_proc.h
src/include/utils/json.h
src/test/regress/expected/json.out
src/test/regress/sql/json.sql