]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add new JSON processing functions and parser API.
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 29 Mar 2013 18:12:13 +0000 (14:12 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 29 Mar 2013 18:12:13 +0000 (14:12 -0400)
commita570c98d7fa0841f17bbf51d62d02d9e493c7fcc
tree6bc54e380252e79ac90c3f56fef8419d1f938230
parent9ad27c215362df436f8c16f1aace923011f31be4
Add new JSON processing functions and parser API.

The JSON parser is converted into a recursive descent parser, and
exposed for use by other modules such as extensions. The API provides
hooks for all the significant parser event such as the beginning and end
of objects and arrays, and providing functions to handle these hooks
allows for fairly simple construction of a wide variety of JSON
processing functions. A set of new basic processing functions and
operators is also added, which use this API, including operations to
extract array elements, object fields, get the length of arrays and the
set of keys of a field, deconstruct an object into a set of key/value
pairs, and create records from JSON objects and arrays of objects.

Catalog version bumped.

Andrew Dunstan, with some documentation assistance from Merlin Moncure.
12 files changed:
doc/src/sgml/func.sgml
src/backend/catalog/system_views.sql
src/backend/utils/adt/Makefile
src/backend/utils/adt/json.c
src/backend/utils/adt/jsonfuncs.c [new file with mode: 0644]
src/include/catalog/catversion.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_proc.h
src/include/utils/json.h
src/include/utils/jsonapi.h [new file with mode: 0644]
src/test/regress/expected/json.out
src/test/regress/sql/json.sql