PostgreSQL Source Code
git master
|
#include "lib/stringinfo.h"
Go to the source code of this file.
Functions | |
void | escape_json (StringInfo buf, const char *str) |
void | escape_json_with_len (StringInfo buf, const char *str, int len) |
void | escape_json_text (StringInfo buf, const text *txt) |
char * | JsonEncodeDateTime (char *buf, Datum value, Oid typid, const int *tzp) |
bool | to_json_is_immutable (Oid typoid) |
Datum | json_build_object_worker (int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null, bool unique_keys) |
Datum | json_build_array_worker (int nargs, const Datum *args, const bool *nulls, const Oid *types, bool absent_on_null) |
bool | json_validate (text *json, bool check_unique_keys, bool throw_error) |
void escape_json | ( | StringInfo | buf, |
const char * | str | ||
) |
Definition at line 1602 of file json.c.
References appendStringInfoCharMacro, buf, escape_json_char(), and str.
Referenced by appendJSONKeyValue(), composite_to_json(), datum_to_json_internal(), escape_yaml(), ExplainDummyGroup(), ExplainOpenGroup(), ExplainProperty(), ExplainPropertyList(), ExplainPropertyListNested(), populate_scalar(), sn_object_field_start(), sn_scalar(), transform_string_values_object_field_start(), transformJsonTableColumn(), and write_jsonlog().
void escape_json_text | ( | StringInfo | buf, |
const text * | txt | ||
) |
Definition at line 1736 of file json.c.
References buf, escape_json_with_len(), len, pfree(), pg_detoast_datum_packed(), str, unconstify, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by datum_to_json_internal(), json_object(), json_object_two_arg(), and transform_string_values_scalar().
void escape_json_with_len | ( | StringInfo | buf, |
const char * | str, | ||
int | len | ||
) |
Definition at line 1631 of file json.c.
References appendBinaryStringInfo(), appendStringInfoCharMacro, Assert, b, buf, chunk, enlargeStringInfo(), escape_json_char(), ESCAPE_JSON_FLUSH_AFTER, i, len, str, vector8_has(), vector8_has_le(), and vector8_load().
Referenced by AddFileToBackupManifest(), escape_json_text(), hstore_to_json(), hstore_to_json_loose(), jsonb_put_escaped_value(), populate_scalar(), and printJsonPathItem().
Datum json_build_array_worker | ( | int | nargs, |
const Datum * | args, | ||
const bool * | nulls, | ||
const Oid * | types, | ||
bool | absent_on_null | ||
) |
Definition at line 1344 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, |
const Datum * | args, | ||
const bool * | nulls, | ||
const Oid * | types, | ||
bool | absent_on_null, | ||
bool | unique_keys | ||
) |
Definition at line 1224 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_throwawaybuf(), json_unique_builder_init(), json_unique_check_key(), sort-test::key, StringInfoData::len, makeStringInfo(), PointerGetDatum(), pstrdup(), skip, and types.
Referenced by ExecEvalJsonConstructor(), and json_build_object().
bool json_validate | ( | text * | json, |
bool | check_unique_keys, | ||
bool | throw_error | ||
) |
Definition at line 1812 of file json.c.
References ereport, errcode(), errmsg(), ERROR, freeJsonLexContext(), json_errsave_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 310 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_internal(), datum_to_jsonb_internal(), and executeItemOptUnwrapTarget().
bool to_json_is_immutable | ( | Oid | typoid | ) |
Definition at line 700 of file json.c.
References 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().