PostgreSQL Source Code
git master
|
#include "lib/stringinfo.h"
Go to the source code of this file.
Enumerations | |
enum | JsonTypeCategory { JSONTYPE_NULL , JSONTYPE_BOOL , JSONTYPE_NUMERIC , JSONTYPE_DATE , JSONTYPE_TIMESTAMP , JSONTYPE_TIMESTAMPTZ , JSONTYPE_JSON , JSONTYPE_ARRAY , JSONTYPE_COMPOSITE , JSONTYPE_CAST , JSONTYPE_OTHER } |
Functions | |
void | escape_json (StringInfo buf, const char *str) |
char * | JsonEncodeDateTime (char *buf, Datum value, Oid typid, const int *tzp) |
bool | to_json_is_immutable (Oid typoid) |
void | json_categorize_type (Oid typoid, JsonTypeCategory *tcategory, Oid *outfuncoid) |
Datum | to_json_worker (Datum val, JsonTypeCategory tcategory, Oid outfuncoid) |
Datum | json_build_object_worker (int nargs, Datum *args, bool *nulls, Oid *types, bool absent_on_null, bool unique_keys) |
Datum | json_build_array_worker (int nargs, Datum *args, bool *nulls, Oid *types, bool absent_on_null) |
bool | json_validate (text *json, bool check_unique_keys, bool throw_error) |
enum JsonTypeCategory |
void escape_json | ( | StringInfo | buf, |
const char * | str | ||
) |
Definition at line 1587 of file json.c.
References appendStringInfo(), appendStringInfoCharMacro, appendStringInfoString(), buf, and generate_unaccent_rules::str.
Referenced by AddFileToBackupManifest(), appendJSONKeyValue(), composite_to_json(), datum_to_json(), escape_yaml(), ExplainDummyGroup(), ExplainOpenGroup(), ExplainProperty(), ExplainPropertyList(), ExplainPropertyListNested(), hstore_to_json(), hstore_to_json_loose(), json_object(), json_object_two_arg(), jsonb_put_escaped_value(), populate_scalar(), printJsonPathItem(), sn_object_field_start(), sn_scalar(), transform_string_values_object_field_start(), transform_string_values_scalar(), transformJsonTableColumn(), and write_jsonlog().
Datum json_build_array_worker | ( | int | nargs, |
Datum * | args, | ||
bool * | nulls, | ||
Oid * | types, | ||
bool | absent_on_null | ||
) |
Definition at line 1352 of file json.c.
References add_json(), appendStringInfoChar(), appendStringInfoString(), generate_unaccent_rules::args, cstring_to_text_with_len(), StringInfoData::data, i, StringInfoData::len, makeStringInfo(), PointerGetDatum, and types.
Referenced by ExecEvalJsonConstructor(), and json_build_array().
Datum json_build_object_worker | ( | int | nargs, |
Datum * | args, | ||
bool * | nulls, | ||
Oid * | types, | ||
bool | absent_on_null, | ||
bool | unique_keys | ||
) |
Definition at line 1238 of file json.c.
References add_json(), appendStringInfoChar(), appendStringInfoString(), generate_unaccent_rules::args, JsonUniqueBuilderState::check, cstring_to_text_with_len(), StringInfoData::data, ereport, errcode(), errhint(), errmsg(), ERROR, i, json_unique_builder_get_skipped_keys(), json_unique_builder_init(), json_unique_check_key(), sort-test::key, StringInfoData::len, makeStringInfo(), PointerGetDatum, skip, and types.
Referenced by ExecEvalJsonConstructor(), and json_build_object().
void json_categorize_type | ( | Oid | typoid, |
JsonTypeCategory * | tcategory, | ||
Oid * | outfuncoid | ||
) |
Definition at line 166 of file json.c.
References COERCION_EXPLICIT, COERCION_PATH_FUNC, find_coercion_pathway(), FirstNormalObjectId, get_element_type(), getBaseType(), getTypeOutputInfo(), InvalidOid, JSONTYPE_ARRAY, JSONTYPE_BOOL, JSONTYPE_CAST, JSONTYPE_COMPOSITE, JSONTYPE_DATE, JSONTYPE_JSON, JSONTYPE_NUMERIC, JSONTYPE_OTHER, JSONTYPE_TIMESTAMP, JSONTYPE_TIMESTAMPTZ, OidIsValid, and type_is_rowtype().
Referenced by add_json(), array_to_json_internal(), composite_to_json(), ExecInitExprRec(), json_agg_transfn_worker(), json_object_agg_transfn_worker(), to_json(), and to_json_is_immutable().
Definition at line 1684 of file json.c.
References ereport, errcode(), errmsg(), ERROR, json_ereport_error(), JSON_SUCCESS, json_unique_check_init(), json_unique_object_end(), json_unique_object_field_start(), json_unique_object_start(), makeJsonLexContext(), nullSemAction, JsonSemAction::object_end, JsonSemAction::object_field_start, JsonSemAction::object_start, pg_parse_json(), and JsonSemAction::semstate.
Referenced by ExecEvalJsonConstructor(), and ExecEvalJsonIsPredicate().
Definition at line 375 of file json.c.
References buf, DATE_NOT_FINITE, DatumGetDateADT, DatumGetTimeADT, DatumGetTimestamp, DatumGetTimestampTz, DatumGetTimeTzADTP, elog, EncodeDateOnly(), EncodeDateTime(), EncodeSpecialDate(), EncodeSpecialTimestamp(), EncodeTimeOnly(), ereport, errcode(), errmsg(), ERROR, j2date(), MAXDATELEN, palloc(), POSTGRES_EPOCH_JDATE, time2tm(), timestamp2tm(), TIMESTAMP_NOT_FINITE, timetz2tm(), tm, pg_tm::tm_isdst, pg_tm::tm_mday, pg_tm::tm_mon, pg_tm::tm_year, USE_XSD_DATES, USECS_PER_SEC, and value.
Referenced by convertJsonbScalar(), datum_to_json(), and datum_to_jsonb().
Definition at line 758 of file json.c.
References func_volatile(), json_categorize_type(), JSONTYPE_ARRAY, JSONTYPE_BOOL, JSONTYPE_CAST, JSONTYPE_COMPOSITE, JSONTYPE_DATE, JSONTYPE_JSON, JSONTYPE_NUMERIC, JSONTYPE_TIMESTAMP, and JSONTYPE_TIMESTAMPTZ.
Referenced by contain_mutable_functions_walker().
Datum to_json_worker | ( | Datum | val, |
JsonTypeCategory | tcategory, | ||
Oid | outfuncoid | ||
) |
Definition at line 748 of file json.c.
References cstring_to_text_with_len(), StringInfoData::data, datum_to_json(), StringInfoData::len, makeStringInfo(), PointerGetDatum, and val.
Referenced by ExecEvalJsonConstructor(), and to_json().