PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | pg_parse_json_or_ereport(lex, sem) (void) pg_parse_json_or_errsave(lex, sem, NULL) |
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) |
bool | pg_parse_json_or_errsave (JsonLexContext *lex, JsonSemAction *sem, struct Node *escontext) |
void | json_errsave_error (JsonParseErrorType error, JsonLexContext *lex, struct Node *escontext) |
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) |
#define pg_parse_json_or_ereport | ( | lex, | |
sem | |||
) | (void) pg_parse_json_or_errsave(lex, sem, NULL) |
Definition at line 46 of file jsonfuncs.h.
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 5432 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 5364 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_errsave_error | ( | JsonParseErrorType | error, |
JsonLexContext * | lex, | ||
struct Node * | escontext | ||
) |
Definition at line 628 of file jsonfuncs.c.
References elog(), errcode(), errdetail_internal(), errmsg(), ERROR, error(), errsave, json_errdetail(), JSON_SEM_ACTION_FAILED, JSON_UNICODE_CODE_POINT_ZERO, JSON_UNICODE_HIGH_ESCAPE, JSON_UNICODE_UNTRANSLATABLE, report_json_context(), and SOFT_ERROR_OCCURRED.
Referenced by get_array_start(), json_get_first_token(), json_typeof(), json_validate(), and pg_parse_json_or_errsave().
JsonTokenType json_get_first_token | ( | text * | json, |
bool | throw_error | ||
) |
Definition at line 5670 of file jsonfuncs.c.
References json_errsave_error(), json_lex(), JSON_SUCCESS, JSON_TOKEN_INVALID, makeJsonLexContext(), and JsonLexContext::token_type.
Referenced by ExecEvalJsonIsPredicate().
JsonLexContext* makeJsonLexContext | ( | text * | json, |
bool | need_escapes | ||
) |
Definition at line 528 of file jsonfuncs.c.
References GetDatabaseEncoding(), makeJsonLexContextCstringLen(), pg_detoast_datum_packed(), 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_typeof(), json_validate(), populate_recordset_worker(), and transform_json_string_values().
Definition at line 5296 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().
bool pg_parse_json_or_errsave | ( | JsonLexContext * | lex, |
JsonSemAction * | sem, | ||
struct Node * | escontext | ||
) |
Definition at line 507 of file jsonfuncs.c.
References json_errsave_error(), JSON_SUCCESS, and pg_parse_json().
Referenced by json_in(), and jsonb_from_cstring().
text* transform_json_string_values | ( | text * | json, |
void * | action_state, | ||
JsonTransformStringValuesAction | transform_action | ||
) |
Definition at line 5552 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 5505 of file jsonfuncs.c.
References JsonbIterator::isScalar, jbvArray, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), pg_detoast_datum_packed(), 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().