-
- Downloads
Add 'ignore_nulls' option to row_to_json
Provide an option to skip NULL values in a row when generating a JSON object from that row with row_to_json. This can reduce the size of the JSON object in cases where columns are NULL without really reducing the information in the JSON object. This also makes row_to_json into a single function with default values, rather than having multiple functions. In passing, change array_to_json to also be a single function with default values (we don't add an 'ignore_nulls' option yet- it's not clear that there is a sensible use-case there, and it hasn't been asked for in any case). Pavel Stehule
Showing
- doc/src/sgml/func.sgml 4 additions, 2 deletionsdoc/src/sgml/func.sgml
- src/backend/catalog/system_views.sql 14 additions, 0 deletionssrc/backend/catalog/system_views.sql
- src/backend/utils/adt/json.c 15 additions, 40 deletionssrc/backend/utils/adt/json.c
- src/include/catalog/catversion.h 1 addition, 1 deletionsrc/include/catalog/catversion.h
- src/include/catalog/pg_proc.h 2 additions, 6 deletionssrc/include/catalog/pg_proc.h
- src/include/utils/json.h 0 additions, 2 deletionssrc/include/utils/json.h
- src/test/regress/expected/json.out 58 additions, 0 deletionssrc/test/regress/expected/json.out
- src/test/regress/sql/json.sql 24 additions, 0 deletionssrc/test/regress/sql/json.sql
Loading
Please register or sign in to comment