PostgreSQL Source Code
git master
|
Go to the source code of this file.
Typedefs | |
typedef enum JsonToIndex | JsonToIndex |
typedef void(* | JsonIterateStringValuesAction) (void *state, char *elem_value, int elem_len) |
typedef text *(* | JsonTransformStringValuesAction) (void *state, char *elem_value, int elem_len) |
Enumerations | |
enum | JsonToIndex { jtiKey = 0x01 , jtiString = 0x02 , jtiNumeric = 0x04 , jtiBool = 0x08 , jtiAll = jtiKey | jtiString | jtiNumeric | jtiBool } |
Functions | |
JsonLexContext * | makeJsonLexContext (text *json, bool need_escapes) |
void | pg_parse_json_or_ereport (JsonLexContext *lex, JsonSemAction *sem) |
void | json_ereport_error (JsonParseErrorType error, JsonLexContext *lex) |
JsonTokenType | json_get_first_token (text *json, bool throw_error) |
uint32 | parse_jsonb_index_flags (Jsonb *jb) |
void | iterate_jsonb_values (Jsonb *jb, uint32 flags, void *state, JsonIterateStringValuesAction action) |
void | iterate_json_values (text *json, uint32 flags, void *action_state, JsonIterateStringValuesAction action) |
Jsonb * | transform_jsonb_string_values (Jsonb *jsonb, void *action_state, JsonTransformStringValuesAction transform_action) |
text * | transform_json_string_values (text *json, void *action_state, JsonTransformStringValuesAction transform_action) |
Datum | json_populate_type (Datum json_val, Oid json_type, Oid typid, int32 typmod, void **cache, MemoryContext mcxt, bool *isnull) |
typedef void(* JsonIterateStringValuesAction) (void *state, char *elem_value, int elem_len) |
Definition at line 34 of file jsonfuncs.h.
typedef enum JsonToIndex JsonToIndex |
Definition at line 37 of file jsonfuncs.h.
enum JsonToIndex |
void iterate_json_values | ( | text * | json, |
uint32 | flags, | ||
void * | action_state, | ||
JsonIterateStringValuesAction | action | ||
) |
Definition at line 5352 of file jsonfuncs.c.
References generate_unaccent_rules::action, iterate_values_object_field_start(), iterate_values_scalar(), makeJsonLexContext(), JsonSemAction::object_field_start, palloc0(), pg_parse_json_or_ereport(), JsonSemAction::scalar, and JsonSemAction::semstate.
Referenced by json_to_tsvector_worker().
void iterate_jsonb_values | ( | Jsonb * | jb, |
uint32 | flags, | ||
void * | state, | ||
JsonIterateStringValuesAction | action | ||
) |
Definition at line 5284 of file jsonfuncs.c.
References generate_unaccent_rules::action, DatumGetCString, DirectFunctionCall1, jbvBool, jbvNumeric, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), jtiBool, jtiKey, jtiNumeric, jtiString, numeric_out(), NumericGetDatum, pfree(), Jsonb::root, generate_unaccent_rules::type, JsonbValue::type, JsonbValue::val, val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by jsonb_to_tsvector_worker().
void json_ereport_error | ( | JsonParseErrorType | error, |
JsonLexContext * | lex | ||
) |
Definition at line 611 of file jsonfuncs.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, error(), json_errdetail(), JSON_UNICODE_CODE_POINT_ZERO, JSON_UNICODE_HIGH_ESCAPE, and report_json_context().
Referenced by get_array_start(), json_get_first_token(), json_validate(), and pg_parse_json_or_ereport().
JsonTokenType json_get_first_token | ( | text * | json, |
bool | throw_error | ||
) |
Definition at line 5571 of file jsonfuncs.c.
References json_ereport_error(), json_lex(), JSON_SUCCESS, JSON_TOKEN_INVALID, makeJsonLexContext(), and JsonLexContext::token_type.
Referenced by ExecEvalJsonIsPredicate(), and json_typeof().
Datum json_populate_type | ( | Datum | json_val, |
Oid | json_type, | ||
Oid | typid, | ||
int32 | typmod, | ||
void ** | cache, | ||
MemoryContext | mcxt, | ||
bool * | isnull | ||
) |
Definition at line 3137 of file jsonfuncs.c.
References DatumGetJsonbP, DatumGetTextPP, JsValue::is_json, jbvBinary, JsValue::json, JSON_TOKEN_INVALID, JsValue::jsonb, MemoryContextAllocZero(), PointerGetDatum, populate_record_field(), Jsonb::root, JsonbValue::type, JsValue::val, JsonbValue::val, VARDATA_ANY, VARHDRSZ, VARSIZE, and VARSIZE_ANY_EXHDR.
Referenced by ExecEvalJsonExprCoercion().
JsonLexContext* makeJsonLexContext | ( | text * | json, |
bool | need_escapes | ||
) |
Definition at line 517 of file jsonfuncs.c.
References GetDatabaseEncoding(), makeJsonLexContextCstringLen(), VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by datum_to_jsonb(), each_worker(), elements_worker(), get_worker(), iterate_json_values(), json_array_length(), json_get_first_token(), json_in(), json_object_keys(), json_strip_nulls(), json_validate(), populate_recordset_worker(), and transform_json_string_values().
Definition at line 5216 of file jsonfuncs.c.
References elog(), ereport, errcode(), errhint(), errmsg(), ERROR, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), jtiAll, jtiBool, jtiKey, jtiNumeric, jtiString, pg_strncasecmp(), pnstrdup(), Jsonb::root, generate_unaccent_rules::type, JsonbValue::type, JsonbValue::val, WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, and WJB_END_ARRAY.
Referenced by json_to_tsvector(), json_to_tsvector_byid(), jsonb_to_tsvector(), and jsonb_to_tsvector_byid().
void pg_parse_json_or_ereport | ( | JsonLexContext * | lex, |
JsonSemAction * | sem | ||
) |
Definition at line 501 of file jsonfuncs.c.
References json_ereport_error(), JSON_SUCCESS, and pg_parse_json().
Referenced by datum_to_jsonb(), each_worker(), elements_worker(), get_json_object_as_hash(), get_worker(), iterate_json_values(), json_array_length(), json_in(), json_object_keys(), json_recv(), json_strip_nulls(), jsonb_from_cstring(), populate_array_json(), populate_recordset_worker(), and transform_json_string_values().
text* transform_json_string_values | ( | text * | json, |
void * | action_state, | ||
JsonTransformStringValuesAction | transform_action | ||
) |
Definition at line 5466 of file jsonfuncs.c.
References JsonSemAction::array_element_start, JsonSemAction::array_end, JsonSemAction::array_start, cstring_to_text_with_len(), makeJsonLexContext(), makeStringInfo(), JsonSemAction::object_end, JsonSemAction::object_field_start, JsonSemAction::object_start, palloc0(), pg_parse_json_or_ereport(), JsonSemAction::scalar, JsonSemAction::semstate, transform_string_values_array_element_start(), transform_string_values_array_end(), transform_string_values_array_start(), transform_string_values_object_end(), transform_string_values_object_field_start(), transform_string_values_object_start(), and transform_string_values_scalar().
Referenced by ts_headline_json_byid_opt().
Jsonb* transform_jsonb_string_values | ( | Jsonb * | jsonb, |
void * | action_state, | ||
JsonTransformStringValuesAction | transform_action | ||
) |
Definition at line 5421 of file jsonfuncs.c.
References JsonbIterator::isScalar, jbvArray, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), pushJsonbValue(), res, Jsonb::root, generate_unaccent_rules::type, JsonbValue::type, JsonbValue::val, VARDATA_ANY, VARSIZE_ANY_EXHDR, WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by ts_headline_jsonb_byid_opt().