Add json_strip_nulls and jsonb_strip_nulls functions.
authorAndrew Dunstan <andrew@dunslane.net>
Fri, 12 Dec 2014 14:00:43 +0000 (09:00 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 12 Dec 2014 14:00:43 +0000 (09:00 -0500)
commit237a8824430c607fce1eafde0c625744d50a455c
treee8f0fcf9806697ef2754e83b24815a2c97af363d
parentb1332e98c441b40300670f55a4303bf69cd8b226
Add json_strip_nulls and jsonb_strip_nulls functions.

The functions remove object fields, including in nested objects, that
have null as a value. In certain cases this can lead to considerably
smaller datums, with no loss of semantic information.

Andrew Dunstan, reviewed by Pavel Stehule.
doc/src/sgml/func.sgml
src/backend/utils/adt/jsonfuncs.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/utils/json.h
src/test/regress/expected/json.out
src/test/regress/expected/json_1.out
src/test/regress/expected/jsonb.out
src/test/regress/expected/jsonb_1.out
src/test/regress/sql/json.sql
src/test/regress/sql/jsonb.sql