|
PostgreSQL Source Code git master
|


Go to the source code of this file.
Data Structures | |
| struct | JsonbContainer |
| struct | Jsonb |
| struct | JsonbValue |
| struct | JsonbPair |
| struct | JsonbInState |
| struct | JsonbParseState |
| struct | JsonbIterator |
Enumerations | |
| enum | JsonbIteratorToken { WJB_DONE , WJB_KEY , WJB_VALUE , WJB_ELEM , WJB_BEGIN_ARRAY , WJB_END_ARRAY , WJB_BEGIN_OBJECT , WJB_END_OBJECT } |
| enum | jbvType { jbvNull = 0x0 , jbvString , jbvNumeric , jbvBool , jbvArray = 0x10 , jbvObject , jbvBinary , jbvDatetime = 0x20 } |
| enum | JsonbIterState { JBI_ARRAY_START , JBI_ARRAY_ELEM , JBI_OBJECT_START , JBI_OBJECT_KEY , JBI_OBJECT_VALUE } |
Definition at line 299 of file jsonb.h.
Definition at line 164 of file jsonb.h.
| #define JBE_ISBOOL | ( | je_ | ) | (JBE_ISBOOL_TRUE(je_) || JBE_ISBOOL_FALSE(je_)) |
| #define JBE_ISBOOL_FALSE | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISBOOL_FALSE) |
| #define JBE_ISBOOL_TRUE | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISBOOL_TRUE) |
| #define JBE_ISCONTAINER | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISCONTAINER) |
| #define JBE_ISNULL | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISNULL) |
| #define JBE_ISNUMERIC | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISNUMERIC) |
| #define JBE_ISSTRING | ( | je_ | ) | (((je_) & JENTRY_TYPEMASK) == JENTRY_ISSTRING) |
| #define JsonContainerIsObject | ( | jc | ) | (((jc)->header & JB_FOBJECT) != 0) |
| #define JsonContainerIsScalar | ( | jc | ) | (((jc)->header & JB_FSCALAR) != 0) |
| #define PG_GETARG_JSONB_P | ( | x | ) | DatumGetJsonbP(PG_GETARG_DATUM(x)) |
| #define PG_GETARG_JSONB_P_COPY | ( | x | ) | DatumGetJsonbPCopy(PG_GETARG_DATUM(x)) |
| Enumerator | |
|---|---|
| jbvNull | |
| jbvString | |
| jbvNumeric | |
| jbvBool | |
| jbvArray | |
| jbvObject | |
| jbvBinary | |
| jbvDatetime | |
Definition at line 227 of file jsonb.h.
| Enumerator | |
|---|---|
| WJB_DONE | |
| WJB_KEY | |
| WJB_VALUE | |
| WJB_ELEM | |
| WJB_BEGIN_ARRAY | |
| WJB_END_ARRAY | |
| WJB_BEGIN_OBJECT | |
| WJB_END_OBJECT | |
Definition at line 20 of file jsonb.h.
| Enumerator | |
|---|---|
| JBI_ARRAY_START | |
| JBI_ARRAY_ELEM | |
| JBI_OBJECT_START | |
| JBI_OBJECT_KEY | |
| JBI_OBJECT_VALUE | |
Definition at line 359 of file jsonb.h.
|
extern |
Definition at line 194 of file jsonb_util.c.
References a, Assert, b, compareJsonbScalarValue(), elog, ERROR, fb(), i, jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbIterator::parent, pfree(), WJB_DONE, WJB_END_ARRAY, and WJB_END_OBJECT.
Referenced by jsonb_cmp(), jsonb_eq(), jsonb_ge(), jsonb_gt(), jsonb_le(), jsonb_lt(), and jsonb_ne().
Definition at line 401 of file jsonb.h.
References PG_DETOAST_DATUM.
Referenced by datum_to_jsonb_internal(), ExecEvalJsonIsPredicate(), json_populate_type(), jsonb_subscript_assign(), jsonb_subscript_fetch(), jsonb_subscript_fetch_old(), JsonItemFromDatum(), JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
Definition at line 407 of file jsonb.h.
References PG_DETOAST_DATUM_COPY.
|
extern |
Definition at line 348 of file jsonb_util.c.
References Assert, JsonbContainer::children, equalsJsonbScalarValue(), fb(), fillJsonbValue(), getKeyJsonValueFromContainer(), i, JB_FARRAY, JB_FOBJECT, JBE_ADVANCE_OFFSET, jbvString, JsonContainerIsArray, JsonContainerIsObject, JsonContainerSize, palloc_object, pfree(), and JsonbValue::type.
Referenced by executeItemOptUnwrapTarget(), getJsonPathVariableFromJsonb(), jsonb_exists(), jsonb_exists_all(), jsonb_exists_any(), and JsonbDeepContains().
|
extern |
Definition at line 472 of file jsonb_util.c.
References JsonbContainer::children, elog, ERROR, fb(), fillJsonbValue(), getJsonbOffset(), i, JsonContainerIsArray, JsonContainerSize, and palloc_object.
Referenced by executeItemOptUnwrapTarget(), jsonb_array_element(), jsonb_array_element_text(), and jsonb_get_element().
|
extern |
Definition at line 162 of file jsonb_util.c.
References fb(), getJsonbOffset(), JBE_HAS_OFF, JBE_OFFLENFLD, and len.
Referenced by fillJsonbValue(), and getKeyJsonValueFromContainer().
|
extern |
Definition at line 137 of file jsonb_util.c.
References fb(), i, JBE_HAS_OFF, and JBE_OFFLENFLD.
Referenced by getIthJsonbValueFromContainer(), getJsonbLength(), getKeyJsonValueFromContainer(), and JsonbIteratorNext().
|
extern |
Definition at line 402 of file jsonb_util.c.
References Assert, JsonbContainer::children, difference(), fb(), fillJsonbValue(), getJsonbLength(), getJsonbOffset(), JsonContainerIsObject, JsonContainerSize, lengthCompareJsonbString(), and palloc_object.
Referenced by findJsonbValueFromContainer(), JsObjectGetField(), jsonb_get_element(), jsonb_object_field(), jsonb_object_field_text(), and JsonbDeepContains().
|
extern |
Definition at line 1247 of file jsonb.c.
References add_jsonb(), fb(), i, JsonbPGetDatum(), JsonbValueToJsonb(), pushJsonbValue(), JsonbInState::result, types, WJB_BEGIN_ARRAY, and WJB_END_ARRAY.
Referenced by ExecEvalJsonConstructor(), and jsonb_build_array().
|
extern |
Definition at line 1162 of file jsonb.c.
References add_jsonb(), ereport, errcode(), errhint(), errmsg(), ERROR, fb(), i, JsonbPGetDatum(), JsonbValueToJsonb(), JsonbInState::parseState, pushJsonbValue(), JsonbInState::result, skip, JsonbParseState::skip_nulls, types, JsonbParseState::unique_keys, WJB_BEGIN_OBJECT, and WJB_END_OBJECT.
Referenced by ExecEvalJsonConstructor(), and jsonb_build_object().
|
extern |
Definition at line 1531 of file jsonfuncs.c.
References Assert, cstring_to_text(), DatumGetTextPP, elog, ERROR, fb(), getIthJsonbValueFromContainer(), getKeyJsonValueFromContainer(), i, IsAJsonbScalar, JB_ROOT_IS_ARRAY, JB_ROOT_IS_OBJECT, JB_ROOT_IS_SCALAR, jbvBinary, jbvNull, JsonbToCString(), JsonbValueAsText(), JsonbValueToJsonb(), JsonContainerIsArray, JsonContainerIsObject, JsonContainerIsScalar, JsonContainerSize, PG_RETURN_JSONB_P, PointerGetDatum(), strtoint(), TextDatumGetCString, VARDATA_ANY(), VARSIZE(), and VARSIZE_ANY_EXHDR().
Referenced by get_jsonb_path_all(), jsonb_subscript_fetch(), and jsonb_subscript_fetch_old().
|
extern |
Definition at line 1679 of file jsonfuncs.c.
References fb(), JB_PATH_CONSISTENT_POSITION, JB_PATH_CREATE, JB_PATH_FILL_GAPS, jbvArray, JsonbIteratorInit(), JsonbValueToJsonb(), newval, palloc0_array, pfree(), PG_RETURN_JSONB_P, and setPath().
Referenced by jsonb_subscript_assign().
|
extern |
Definition at line 1189 of file jsonb_util.c.
References Assert, check_stack_depth(), elog, equalsJsonbScalarValue(), ERROR, fb(), findJsonbValueFromContainer(), getKeyJsonValueFromContainer(), i, IsAJsonbScalar, j, JB_FARRAY, jbvArray, jbvBinary, jbvObject, jbvString, JsonbDeepContains(), JsonbIteratorInit(), JsonbIteratorNext(), palloc_array, pfree(), JsonbValue::val, val, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_ELEM, WJB_END_ARRAY, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by jsonb_contained(), jsonb_contains(), and JsonbDeepContains().
|
extern |
Definition at line 1781 of file jsonb.c.
References Assert, fb(), IsAJsonbScalar, jbvArray, jbvObject, JsonbIteratorInit(), JsonbIteratorNext(), JsonContainerIsArray, JsonContainerIsScalar, PG_USED_FOR_ASSERTS_ONLY, JsonbValue::type, JsonbValue::val, WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, and WJB_END_ARRAY.
Referenced by executeJsonPath(), jsonb_bool(), jsonb_float4(), jsonb_float8(), jsonb_int2(), jsonb_int4(), jsonb_int8(), jsonb_numeric(), JsonbContainerTypeName(), JsonbUnquote(), JsonItemFromDatum(), and JsonPathValue().
|
extern |
Definition at line 1443 of file jsonb_util.c.
References DatumGetUInt32(), DirectFunctionCall1, elog, ERROR, fb(), hash(), hash_any(), hash_numeric(), jbvBool, jbvNull, jbvNumeric, jbvString, NumericGetDatum(), and pg_rotate_left32().
Referenced by gin_extract_jsonb_path(), jsonb_hash(), jsonb_path_ops__add_path_item(), and jsonb_path_ops__extract_nodes().
|
extern |
Definition at line 1486 of file jsonb_util.c.
References BoolGetDatum(), DatumGetUInt64(), DirectFunctionCall2, elog, ERROR, fb(), hash(), hash_any_extended(), hash_numeric_extended(), hashcharextended(), jbvBool, jbvNull, jbvNumeric, jbvString, NumericGetDatum(), ROTATE_HIGH_AND_LOW_32BITS, and UInt64GetDatum().
Referenced by jsonb_hash_extended().
|
extern |
Definition at line 935 of file jsonb_util.c.
References fb(), and iteratorFromContainer().
Referenced by compareJsonbContainers(), datum_to_jsonb_internal(), each_worker_jsonb(), elements_worker_jsonb(), executeAnyItem(), executeKeyValueMethod(), gin_extract_jsonb(), gin_extract_jsonb_path(), iterate_jsonb_values(), jsonb_concat(), jsonb_contained(), jsonb_contains(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_hash(), jsonb_hash_extended(), jsonb_insert(), jsonb_object_keys(), jsonb_set(), jsonb_set_element(), jsonb_strip_nulls(), Jsonb_to_SV(), JsonbDeepContains(), JsonbExtractScalar(), JsonbToCStringWorker(), parse_jsonb_index_flags(), PLyObject_FromJsonbContainer(), populate_array_dim_jsonb(), populate_recordset_worker(), pushJsonbValue(), and transform_jsonb_string_values().
|
extern |
Definition at line 973 of file jsonb_util.c.
References elog, ERROR, fb(), fillJsonbValue(), freeAndGetParent(), getJsonbOffset(), IsAJsonbScalar, iteratorFromContainer(), JBE_ADVANCE_OFFSET, JBI_ARRAY_ELEM, JBI_ARRAY_START, JBI_OBJECT_KEY, JBI_OBJECT_START, JBI_OBJECT_VALUE, jbvArray, jbvNull, jbvObject, jbvString, val, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_DONE, WJB_ELEM, WJB_END_ARRAY, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by compareJsonbContainers(), datum_to_jsonb_internal(), each_worker_jsonb(), elements_worker_jsonb(), executeAnyItem(), executeKeyValueMethod(), gin_extract_jsonb(), gin_extract_jsonb_path(), iterate_jsonb_values(), IteratorConcat(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_hash(), jsonb_hash_extended(), jsonb_object_keys(), jsonb_strip_nulls(), Jsonb_to_SV(), JsonbDeepContains(), JsonbExtractScalar(), JsonbToCStringWorker(), parse_jsonb_index_flags(), PLyObject_FromJsonbContainer(), populate_array_dim_jsonb(), populate_recordset_worker(), pushJsonbValue(), setPath(), setPathArray(), setPathObject(), and transform_jsonb_string_values().
Definition at line 413 of file jsonb.h.
References PointerGetDatum().
Referenced by datum_to_jsonb(), ExecEvalJsonExprPath(), ExecGetJsonValueItemString(), jsonb_build_array_worker(), jsonb_build_object_worker(), jsonb_path_query_internal(), JsonItemFromDatum(), JsonPathQuery(), JsonTablePlanScanNextRow(), and populate_scalar().
|
extern |
Definition at line 466 of file jsonb.c.
References fb(), and JsonbToCStringWorker().
Referenced by jsonb_get_element(), jsonb_out(), jsonb_send(), JsonbUnquote(), JsonbValueAsText(), and populate_scalar().
|
extern |
Definition at line 475 of file jsonb.c.
References fb(), and JsonbToCStringWorker().
Referenced by jsonb_pretty().
|
extern |
Definition at line 76 of file jsonb_util.c.
References jbvBinary, Jsonb::root, val, VARHDRSZ, and VARSIZE().
Referenced by jsonb_insert(), jsonb_set(), and jsonb_subscript_assign().
|
extern |
Definition at line 173 of file jsonb.c.
References elog, ERROR, fb(), jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, JsonbContainerTypeName(), and val.
Referenced by executeItemOptUnwrapTarget(), and JsonbContainerTypeName().
Definition at line 2042 of file jsonb.c.
References DatumGetCString(), DirectFunctionCall1, elog, ERROR, fb(), JB_ROOT_IS_SCALAR, jbvBool, jbvNull, jbvNumeric, jbvString, JsonbExtractScalar(), JsonbToCString(), numeric_out(), pnstrdup(), PointerGetDatum(), pstrdup(), JsonbValue::type, JsonbValue::val, and VARSIZE().
Referenced by json_populate_type().
|
extern |
Definition at line 96 of file jsonb_util.c.
References Assert, convertToJsonb(), fb(), IsAJsonbScalar, jbvArray, jbvBinary, jbvObject, palloc(), pushJsonbValue(), JsonbInState::result, SET_VARSIZE(), JsonbValue::type, val, VARDATA(), VARHDRSZ, WJB_BEGIN_ARRAY, WJB_ELEM, and WJB_END_ARRAY.
Referenced by datum_to_jsonb(), each_worker_jsonb(), elements_worker_jsonb(), ExecEvalJsonExprPath(), ExecGetJsonValueItemString(), executeKeyValueMethod(), hstore_to_jsonb(), hstore_to_jsonb_loose(), jsonb_agg_finalfn(), jsonb_array_element(), jsonb_build_array_noargs(), jsonb_build_array_worker(), jsonb_build_object_noargs(), jsonb_build_object_worker(), jsonb_concat(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_delete_path(), jsonb_from_cstring(), jsonb_get_element(), jsonb_insert(), jsonb_object(), jsonb_object_agg_finalfn(), jsonb_object_field(), jsonb_object_two_arg(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), jsonb_path_query_internal(), jsonb_set(), jsonb_set_element(), jsonb_strip_nulls(), jsonb_subscript_assign(), JsonPathQuery(), JsonTablePlanScanNextRow(), plperl_to_jsonb(), plpython_to_jsonb(), populate_scalar(), and transform_jsonb_string_values().
|
extern |
Definition at line 583 of file jsonb_util.c.
References Assert, fb(), i, IsAJsonbScalar, JB_FSCALAR, jbvArray, jbvBinary, jbvObject, JsonbIteratorInit(), JsonbIteratorNext(), JsonbInState::parseState, pushJsonbValue(), pushJsonbValueScalar(), JsonbValue::type, JsonbValue::val, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_DONE, WJB_ELEM, WJB_END_ARRAY, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by array_dim_to_jsonb(), array_to_jsonb_internal(), AV_to_JsonbValue(), composite_to_jsonb(), datum_to_jsonb_internal(), executeKeyValueMethod(), hstore_to_jsonb(), hstore_to_jsonb_loose(), HV_to_JsonbValue(), IteratorConcat(), jsonb_agg_finalfn(), jsonb_agg_transfn_worker(), jsonb_build_array_noargs(), jsonb_build_array_worker(), jsonb_build_object_noargs(), jsonb_build_object_worker(), jsonb_delete(), jsonb_delete_array(), jsonb_delete_idx(), jsonb_in_array_end(), jsonb_in_array_start(), jsonb_in_object_end(), jsonb_in_object_field_start(), jsonb_in_object_start(), jsonb_in_scalar(), jsonb_object(), jsonb_object_agg_finalfn(), jsonb_object_agg_transfn_worker(), jsonb_object_two_arg(), jsonb_strip_nulls(), JsonbValueToJsonb(), PLyMapping_ToJsonbValue(), PLyObject_ToJsonbValue(), PLySequence_ToJsonbValue(), push_null_elements(), push_path(), pushJsonbValue(), setPath(), setPathArray(), setPathObject(), SV_to_JsonbValue(), transform_jsonb_string_values(), and wrapItemsInArray().
Definition at line 1086 of file jsonb.c.
References fb(), func_volatile(), json_categorize_type(), JSONTYPE_ARRAY, JSONTYPE_BOOL, JSONTYPE_CAST, JSONTYPE_COMPOSITE, JSONTYPE_DATE, JSONTYPE_JSON, JSONTYPE_JSONB, JSONTYPE_NULL, JSONTYPE_NUMERIC, JSONTYPE_OTHER, JSONTYPE_TIMESTAMP, and JSONTYPE_TIMESTAMPTZ.
Referenced by contain_mutable_functions_walker().