pgsql: Add new JSON processing functions and parser API.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add new JSON processing functions and parser API.
Date: 2013-03-29 18:13:31
Message-ID: E1ULdnv-0002oU-VL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a570c98d7fa0841f17bbf51d62d02d9e493c7fcc

Modified Files
--------------
doc/src/sgml/func.sgml | 242 +++++-
src/backend/catalog/system_views.sql | 8 +
src/backend/utils/adt/Makefile | 4 +-
src/backend/utils/adt/json.c | 908 +++++++++++------
src/backend/utils/adt/jsonfuncs.c | 1919 ++++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_operator.h | 13 +
src/include/catalog/pg_proc.h | 31 +
src/include/utils/json.h | 16 +
src/include/utils/jsonapi.h | 110 ++
src/test/regress/expected/json.out | 463 ++++++++
src/test/regress/sql/json.sql | 171 +++
12 files changed, 3578 insertions(+), 309 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message David Fetter 2013-03-29 19:12:40 Re: [COMMITTERS] pgsql: Add parallel pg_dump option.
Previous Message Tom Lane 2013-03-29 03:15:34 pgsql: Document encode(bytea, 'escape')'s behavior correctly.