pgsql: Add new JSON processing functions and parser API.

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

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(-)

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

#2Dickson S. Guedes
listas@guedesoft.net
In reply to: Andrew Dunstan (#1)
Re: pgsql: Add new JSON processing functions and parser API.

2013/3/29 Andrew Dunstan <andrew@dunslane.net>:

Add new JSON processing functions and parser API.

This commit introduced wrong examples in funcs.sgml.

For historical purpose this is the link to the patch in -hackers.

/messages/by-id/CAHHcreqE3==rU-h9V5+Uqbo8Gf779BNpxHH6HymWWdw=gwEAmQ@mail.gmail.com

Thanks! Regards.
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://github.com/guedes - http://guedesoft.net
http://www.postgresql.org.br

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

#3Andrew Dunstan
andrew@dunslane.net
In reply to: Dickson S. Guedes (#2)
Re: pgsql: Add new JSON processing functions and parser API.

On 04/01/2013 08:56 AM, Dickson S. Guedes wrote:

2013/3/29 Andrew Dunstan <andrew@dunslane.net>:

Add new JSON processing functions and parser API.

This commit introduced wrong examples in funcs.sgml.

For historical purpose this is the link to the patch in -hackers.

/messages/by-id/CAHHcreqE3==rU-h9V5+Uqbo8Gf779BNpxHH6HymWWdw=gwEAmQ@mail.gmail.com

Thanks! Regards.

I saw your message from last night on -hackers. Have a little patience
and I'll fix it,

Thanks

andrew

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