pgsql: Add json_strip_nulls and jsonb_strip_nulls functions. - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Add json_strip_nulls and jsonb_strip_nulls functions.
Date
Msg-id E1XzQnA-0003et-Ce@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/237a8824430c607fce1eafde0c625744d50a455c

Modified Files
--------------
doc/src/sgml/func.sgml                |   23 ++++
src/backend/utils/adt/jsonfuncs.c     |  197 +++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h      |    2 +-
src/include/catalog/pg_proc.h         |    5 +
src/include/utils/json.h              |    2 +
src/test/regress/expected/json.out    |   50 +++++++++
src/test/regress/expected/json_1.out  |   50 +++++++++
src/test/regress/expected/jsonb.out   |   50 +++++++++
src/test/regress/expected/jsonb_1.out |   50 +++++++++
src/test/regress/sql/json.sql         |   20 ++++
src/test/regress/sql/jsonb.sql        |   19 ++++
11 files changed, 467 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Put the logic to decide which synchronous standby is active into
Next
From: Tom Lane
Date:
Subject: pgsql: Revert misguided change to postgres_fdw FOR UPDATE/SHARE code.