Add several generator functions for jsonb that exist for json.
Andrew Dunstan <andrew@dunslane.net>
Add several generator functions for jsonb that exist for json.
The functions are:
to_jsonb()
jsonb_object()
jsonb_build_object()
jsonb_build_array()
jsonb_agg()
jsonb_object_agg()
Also along the way some better logic is implemented in
json_categorize_type() to match that in the newly implemented
jsonb_categorize_type().
Andrew Dunstan, reviewed by Pavel Stehule and Alvaro Herrera.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +72 −25 |
| src/backend/utils/adt/jsonb.c | modified | +1396 −0 |
| src/backend/utils/adt/jsonb_util.c | modified | +1 −1 |
| src/backend/utils/adt/json.c | modified | +26 −18 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_aggregate.h | modified | +4 −0 |
| src/include/catalog/pg_proc.h | modified | +26 −0 |
| src/include/utils/jsonb.h | modified | +16 −0 |
| src/test/regress/expected/jsonb_1.out | modified | +173 −0 |
| src/test/regress/expected/jsonb.out | modified | +173 −0 |
| src/test/regress/sql/jsonb.sql | modified | +115 −0 |