From 237a8824430c607fce1eafde0c625744d50a455c Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Fri, 12 Dec 2014 09:00:43 -0500 Subject: 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. --- src/include/utils/json.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/utils/json.h') diff --git a/src/include/utils/json.h b/src/include/utils/json.h index 82cc48b7113..cada47e96e7 100644 --- a/src/include/utils/json.h +++ b/src/include/utils/json.h @@ -63,6 +63,7 @@ extern Datum json_populate_record(PG_FUNCTION_ARGS); extern Datum json_populate_recordset(PG_FUNCTION_ARGS); extern Datum json_to_record(PG_FUNCTION_ARGS); extern Datum json_to_recordset(PG_FUNCTION_ARGS); +extern Datum json_strip_nulls(PG_FUNCTION_ARGS); extern Datum jsonb_object_field(PG_FUNCTION_ARGS); extern Datum jsonb_object_field_text(PG_FUNCTION_ARGS); @@ -80,5 +81,6 @@ extern Datum jsonb_populate_record(PG_FUNCTION_ARGS); extern Datum jsonb_populate_recordset(PG_FUNCTION_ARGS); extern Datum jsonb_to_record(PG_FUNCTION_ARGS); extern Datum jsonb_to_recordset(PG_FUNCTION_ARGS); +extern Datum jsonb_strip_nulls(PG_FUNCTION_ARGS); #endif /* JSON_H */ -- cgit v1.2.3