New json functions.
Andrew Dunstan <andrew@dunslane.net>
New json functions. json_build_array() and json_build_object allow for the construction of arbitrarily complex json trees. json_object() turns a one or two dimensional array, or two separate arrays, into a json_object of name/value pairs, similarly to the hstore() function. json_object_agg() aggregates its two arguments into a single json object as name value pairs. Catalog version bumped. Andrew Dunstan, reviewed by Marko Tiikkaja.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +158 −0 |
| src/backend/utils/adt/json.c | modified | +558 −19 |
| src/backend/utils/adt/jsonfuncs.c | modified | +127 −49 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_aggregate.h | modified | +1 −0 |
| src/include/catalog/pg_proc.h | modified | +22 −0 |
| src/include/utils/json.h | modified | +13 −0 |
| src/test/regress/expected/json_1.out | modified | +126 −0 |
| src/test/regress/expected/json.out | modified | +126 −0 |
| src/test/regress/sql/json.sql | modified | +87 −0 |