Allow json{b}_strip_nulls to remove null array elements
Andrew Dunstan <andrew@dunslane.net>
Allow json{b}_strip_nulls to remove null array elements
An additional paramater ("strip_in_arrays") is added to these functions.
It defaults to false. If true, then null array elements are removed as
well as null valued object fields. JSON that just consists of a single
null is not affected.
Author: Florents Tselai <florents.tselai@gmail.com>
Discussion: https://postgr.es/m/4BCECCD5-4F40-4313-9E98-9E16BEB0B01D@gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +12 −5 |
| src/backend/catalog/system_functions.sql | modified | +14 −0 |
| src/backend/utils/adt/jsonfuncs.c | modified | +25 −2 |
| src/include/catalog/pg_proc.dat | modified | +2 −2 |
| src/test/regress/expected/jsonb.out | modified | +50 −0 |
| src/test/regress/expected/json.out | modified | +50 −0 |
| src/test/regress/sql/jsonb.sql | modified | +18 −0 |
| src/test/regress/sql/json.sql | modified | +19 −0 |
Documentation touched
Discussion
- jsonb_strip_nulls with arrays? 13 messages · 2024-09-17 → 2025-03-06