|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <limits.h>#include "access/htup_details.h"#include "access/tupdesc.h"#include "catalog/pg_proc.h"#include "catalog/pg_type.h"#include "common/int.h"#include "common/jsonapi.h"#include "common/string.h"#include "fmgr.h"#include "funcapi.h"#include "lib/stringinfo.h"#include "mb/pg_wchar.h"#include "miscadmin.h"#include "nodes/miscnodes.h"#include "parser/parse_coerce.h"#include "utils/array.h"#include "utils/builtins.h"#include "utils/fmgroids.h"#include "utils/hsearch.h"#include "utils/json.h"#include "utils/jsonb.h"#include "utils/jsonfuncs.h"#include "utils/lsyscache.h"#include "utils/memutils.h"#include "utils/syscache.h"#include "utils/tuplestore.h"#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
| struct | OkeysState |
| struct | IterateJsonStringValuesState |
| struct | TransformJsonStringValuesState |
| struct | GetState |
| struct | AlenState |
| struct | EachState |
| struct | ElementsState |
| struct | JHashState |
| struct | JsonHashEntry |
| struct | ScalarIOData |
| struct | ArrayIOData |
| struct | CompositeIOData |
| struct | DomainIOData |
| struct | ColumnIOData |
| struct | RecordIOData |
| struct | PopulateRecordCache |
| struct | PopulateRecordsetState |
| struct | PopulateArrayContext |
| struct | PopulateArrayState |
| struct | StripnullState |
| struct | JsValue |
| struct | JsObject |
Macros | |
| #define | JB_PATH_CREATE 0x0001 |
| #define | JB_PATH_DELETE 0x0002 |
| #define | JB_PATH_REPLACE 0x0004 |
| #define | JB_PATH_INSERT_BEFORE 0x0008 |
| #define | JB_PATH_INSERT_AFTER 0x0010 |
| #define | JB_PATH_CREATE_OR_INSERT (JB_PATH_INSERT_BEFORE | JB_PATH_INSERT_AFTER | JB_PATH_CREATE) |
| #define | JB_PATH_FILL_GAPS 0x0020 |
| #define | JB_PATH_CONSISTENT_POSITION 0x0040 |
| #define | JsValueIsNull(jsv) |
| #define | JsValueIsString(jsv) |
| #define | JsObjectIsEmpty(jso) |
| #define | JsObjectFree(jso) |
Enumerations | |
| enum | TypeCat { TYPECAT_SCALAR = 's' , TYPECAT_ARRAY = 'a' , TYPECAT_COMPOSITE = 'c' , TYPECAT_COMPOSITE_DOMAIN = 'C' , TYPECAT_DOMAIN = 'd' } |
| #define JB_PATH_CONSISTENT_POSITION 0x0040 |
Definition at line 55 of file jsonfuncs.c.
| #define JB_PATH_CREATE 0x0001 |
Definition at line 47 of file jsonfuncs.c.
| #define JB_PATH_CREATE_OR_INSERT (JB_PATH_INSERT_BEFORE | JB_PATH_INSERT_AFTER | JB_PATH_CREATE) |
Definition at line 52 of file jsonfuncs.c.
| #define JB_PATH_DELETE 0x0002 |
Definition at line 48 of file jsonfuncs.c.
| #define JB_PATH_FILL_GAPS 0x0020 |
Definition at line 54 of file jsonfuncs.c.
| #define JB_PATH_INSERT_AFTER 0x0010 |
Definition at line 51 of file jsonfuncs.c.
| #define JB_PATH_INSERT_BEFORE 0x0008 |
Definition at line 50 of file jsonfuncs.c.
| #define JB_PATH_REPLACE 0x0004 |
Definition at line 49 of file jsonfuncs.c.
Definition at line 332 of file jsonfuncs.c.
| typedef struct ArrayIOData ArrayIOData |
| typedef struct ColumnIOData ColumnIOData |
Definition at line 165 of file jsonfuncs.c.
| typedef struct DomainIOData DomainIOData |
| typedef struct ElementsState ElementsState |
| typedef struct JHashState JHashState |
| typedef struct JsonHashEntry JsonHashEntry |
| typedef struct OkeysState OkeysState |
| typedef struct RecordIOData RecordIOData |
Definition at line 166 of file jsonfuncs.c.
| typedef struct ScalarIOData ScalarIOData |
| typedef struct StripnullState StripnullState |
| Enumerator | |
|---|---|
| TYPECAT_SCALAR | |
| TYPECAT_ARRAY | |
| TYPECAT_COMPOSITE | |
| TYPECAT_COMPOSITE_DOMAIN | |
| TYPECAT_DOMAIN | |
Definition at line 202 of file jsonfuncs.c.
|
static |
Definition at line 1928 of file jsonfuncs.c.
References fb(), and JSON_SUCCESS.
Referenced by json_array_length().
|
static |
Definition at line 1900 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by json_array_length().
|
static |
Definition at line 1914 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by json_array_length().
|
static |
Definition at line 3476 of file jsonfuncs.c.
References data, fb(), InvalidOid, MemoryContextAlloc(), MemSet, and RecordIOData::record_type.
Referenced by populate_record().
|
static |
Definition at line 2168 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by each_worker().
|
static |
Definition at line 2120 of file jsonfuncs.c.
References cstring_to_text_with_len(), CStringGetTextDatum, fb(), heap_form_tuple(), JSON_SUCCESS, len, MemoryContextReset(), MemoryContextSwitchTo(), PointerGetDatum(), tuplestore_puttuple(), val, and values.
Referenced by each_worker().
|
static |
Definition at line 2098 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, and JSON_TOKEN_STRING.
Referenced by each_worker().
|
static |
Definition at line 2182 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JSON_SUCCESS, and token.
Referenced by each_worker().
|
static |
Definition at line 2058 of file jsonfuncs.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, JsonSemAction::array_start, CurrentMemoryContext, each_array_start(), each_object_field_end(), each_object_field_start(), each_scalar(), fb(), freeJsonLexContext(), InitMaterializedSRF(), makeJsonLexContext(), MAT_SRF_BLESS, MemoryContextDelete(), JsonSemAction::object_field_end, JsonSemAction::object_field_start, palloc0_object, PG_GETARG_TEXT_PP, pg_parse_json_or_ereport, PG_RETURN_NULL, FunctionCallInfoBaseData::resultinfo, JsonSemAction::scalar, sem, JsonSemAction::semstate, ReturnSetInfo::setDesc, and ReturnSetInfo::setResult.
Referenced by json_each(), and json_each_text().
|
static |
Definition at line 1974 of file jsonfuncs.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, cstring_to_text_with_len(), CurrentMemoryContext, ereport, errcode(), errmsg, ERROR, fb(), funcname, InitMaterializedSRF(), JB_ROOT_IS_OBJECT, jbvNull, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueAsText(), JsonbValueToJsonb(), MAT_SRF_BLESS, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), PG_GETARG_JSONB_P, PG_RETURN_NULL, PointerGetDatum(), FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), JsonbValue::type, JsonbValue::val, val, values, WJB_DONE, and WJB_KEY.
Referenced by jsonb_each(), and jsonb_each_text().
|
static |
Definition at line 2372 of file jsonfuncs.c.
References cstring_to_text_with_len(), CStringGetTextDatum, fb(), heap_form_tuple(), JSON_SUCCESS, len, MemoryContextReset(), MemoryContextSwitchTo(), PointerGetDatum(), tuplestore_puttuple(), val, and values.
Referenced by elements_worker().
|
static |
Definition at line 2350 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, and JSON_TOKEN_STRING.
Referenced by elements_worker().
|
static |
Definition at line 2418 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by elements_worker().
|
static |
Definition at line 2433 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JSON_SUCCESS, and token.
Referenced by elements_worker().
|
static |
Definition at line 2308 of file jsonfuncs.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, JsonSemAction::array_element_end, JsonSemAction::array_element_start, CurrentMemoryContext, elements_array_element_end(), elements_array_element_start(), elements_object_start(), elements_scalar(), fb(), freeJsonLexContext(), funcname, InitMaterializedSRF(), makeJsonLexContext(), MAT_SRF_BLESS, MAT_SRF_USE_EXPECTED_DESC, MemoryContextDelete(), JsonSemAction::object_start, palloc0_object, PG_GETARG_TEXT_PP, pg_parse_json_or_ereport, PG_RETURN_NULL, FunctionCallInfoBaseData::resultinfo, JsonSemAction::scalar, sem, JsonSemAction::semstate, ReturnSetInfo::setDesc, and ReturnSetInfo::setResult.
Referenced by json_array_elements(), and json_array_elements_text().
|
static |
Definition at line 2220 of file jsonfuncs.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, CurrentMemoryContext, ereport, errcode(), errmsg, ERROR, fb(), InitMaterializedSRF(), JB_ROOT_IS_ARRAY, JB_ROOT_IS_SCALAR, jbvNull, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueAsText(), JsonbValueToJsonb(), MAT_SRF_BLESS, MAT_SRF_USE_EXPECTED_DESC, MemoryContextDelete(), MemoryContextReset(), MemoryContextSwitchTo(), PG_GETARG_JSONB_P, PG_RETURN_NULL, PointerGetDatum(), FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, tuplestore_putvalues(), JsonbValue::type, val, values, WJB_DONE, and WJB_ELEM.
Referenced by jsonb_array_elements(), and jsonb_array_elements_text().
|
static |
Definition at line 1404 of file jsonfuncs.c.
References cstring_to_text_with_len(), fb(), JSON_SUCCESS, len, and start.
Referenced by get_worker().
|
static |
Definition at line 1356 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, and JSON_TOKEN_STRING.
Referenced by get_worker().
|
static |
Definition at line 1338 of file jsonfuncs.c.
References cstring_to_text_with_len(), fb(), JSON_SUCCESS, len, and start.
Referenced by get_worker().
|
static |
Definition at line 1298 of file jsonfuncs.c.
References error(), fb(), json_count_array_elements(), json_errsave_error(), and JSON_SUCCESS.
Referenced by get_worker().
|
static |
Definition at line 3811 of file jsonfuncs.c.
References JsonSemAction::array_start, ctl, CurrentMemoryContext, fb(), freeJsonLexContext(), funcname, GetDatabaseEncoding(), hash_array_start(), HASH_CONTEXT, hash_create(), hash_destroy(), HASH_ELEM, hash_object_field_end(), hash_object_field_start(), hash_scalar(), HASH_STRINGS, len, makeJsonLexContextCstringLen(), NAMEDATALEN, JsonSemAction::object_field_end, JsonSemAction::object_field_start, palloc0_object, pg_parse_json_or_errsave(), JsonSemAction::scalar, sem, and JsonSemAction::semstate.
Referenced by JsValueToJsObject().
|
static |
Definition at line 1503 of file jsonfuncs.c.
References array_contains_nulls(), deconstruct_array_builtin(), fb(), jsonb_get_element(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_JSONB_P, PG_RETURN_DATUM, and PG_RETURN_NULL.
Referenced by jsonb_extract_path(), and jsonb_extract_path_text().
|
static |
Definition at line 1182 of file jsonfuncs.c.
References cstring_to_text_with_len(), fb(), JSON_SUCCESS, len, and start.
Referenced by get_worker().
|
static |
Definition at line 1247 of file jsonfuncs.c.
References cstring_to_text_with_len(), fb(), JSON_SUCCESS, len, and start.
Referenced by get_worker().
|
static |
Definition at line 1200 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, and JSON_TOKEN_STRING.
Referenced by get_worker().
|
static |
Definition at line 1163 of file jsonfuncs.c.
References fb(), and JSON_SUCCESS.
Referenced by get_worker().
|
static |
Definition at line 1027 of file jsonfuncs.c.
References array_contains_nulls(), Assert, deconstruct_array_builtin(), fb(), get_worker(), i, palloc_array, PG_GETARG_ARRAYTYPE_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, strtoint(), and TextDatumGetCString.
Referenced by json_extract_path(), and json_extract_path_text().
|
static |
Definition at line 3636 of file jsonfuncs.c.
References PopulateRecordCache::argtype, PopulateRecordCache::c, ereport, errcode(), errmsg, ERROR, fb(), FunctionCallInfoBaseData::flinfo, PopulateRecordCache::fn_mcxt, funcname, get_fn_expr_argtype(), prepare_column_cache(), ColumnIOData::typcat, TYPECAT_COMPOSITE, and TYPECAT_COMPOSITE_DOMAIN.
Referenced by populate_record_worker(), and populate_recordset_worker().
|
static |
Definition at line 3662 of file jsonfuncs.c.
References PopulateRecordCache::argtype, Assert, CompositeIOData::base_typid, CompositeIOData::base_typmod, PopulateRecordCache::c, ColumnIOData::composite, CreateTupleDescCopy(), ereport, errcode(), errhint(), errmsg, ERROR, fb(), PopulateRecordCache::fn_mcxt, FreeTupleDesc(), funcname, get_call_result_type(), ColumnIOData::io, MemoryContextSwitchTo(), TupleDescData::tdtypeid, TupleDescData::tdtypmod, CompositeIOData::tupdesc, and TYPEFUNC_COMPOSITE.
Referenced by populate_record_worker(), and populate_recordset_worker().
|
static |
Definition at line 1448 of file jsonfuncs.c.
References cstring_to_text(), cstring_to_text_with_len(), fb(), JSON_SUCCESS, JSON_TOKEN_NULL, JSON_TOKEN_STRING, len, and start.
Referenced by get_worker().
|
static |
Definition at line 1106 of file jsonfuncs.c.
References JsonSemAction::array_element_end, JsonSemAction::array_element_start, JsonSemAction::array_end, JsonSemAction::array_start, Assert, fb(), freeJsonLexContext(), get_array_element_end(), get_array_element_start(), get_array_end(), get_array_start(), get_object_end(), get_object_field_end(), get_object_field_start(), get_object_start(), get_scalar(), makeJsonLexContext(), JsonSemAction::object_end, JsonSemAction::object_field_end, JsonSemAction::object_field_start, JsonSemAction::object_start, palloc0_array, palloc0_object, palloc_array, pg_parse_json_or_ereport, JsonSemAction::scalar, sem, and JsonSemAction::semstate.
Referenced by get_path_all(), json_array_element(), json_array_element_text(), json_object_field(), and json_object_field_text().
|
static |
Definition at line 3930 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by get_json_object_as_hash().
|
static |
Definition at line 3879 of file jsonfuncs.c.
References Assert, fb(), HASH_ENTER, hash_search(), JSON_SUCCESS, JSON_TOKEN_NULL, len, NAMEDATALEN, palloc(), and val.
Referenced by get_json_object_as_hash().
|
static |
Definition at line 3853 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, JSON_TOKEN_ARRAY_START, and JSON_TOKEN_OBJECT_START.
Referenced by get_json_object_as_hash().
|
static |
Definition at line 3943 of file jsonfuncs.c.
References Assert, ereport, errcode(), errmsg, ERROR, fb(), JSON_SUCCESS, and token.
Referenced by get_json_object_as_hash().
| void iterate_json_values | ( | text * | json, |
| uint32 | flags, | ||
| void * | action_state, | ||
| JsonIterateStringValuesAction | action | ||
| ) |
Definition at line 5698 of file jsonfuncs.c.
References freeJsonLexContext(), iterate_values_object_field_start(), iterate_values_scalar(), makeJsonLexContext(), JsonSemAction::object_field_start, palloc0_object, pg_parse_json_or_ereport, JsonSemAction::scalar, sem, and JsonSemAction::semstate.
Referenced by json_to_tsvector_worker().
| void iterate_jsonb_values | ( | Jsonb * | jb, |
| uint32 | flags, | ||
| void * | state, | ||
| JsonIterateStringValuesAction | action | ||
| ) |
Definition at line 5630 of file jsonfuncs.c.
References DatumGetCString(), DirectFunctionCall1, fb(), jbvBool, jbvNumeric, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), jtiBool, jtiKey, jtiNumeric, jtiString, numeric_out(), NumericGetDatum(), pfree(), type, JsonbValue::type, JsonbValue::val, val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by jsonb_to_tsvector_worker().
|
static |
Definition at line 5751 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, jtiKey, pstrdup(), and val.
Referenced by iterate_json_values().
|
static |
Definition at line 5723 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, JSON_TOKEN_FALSE, JSON_TOKEN_NUMBER, JSON_TOKEN_STRING, JSON_TOKEN_TRUE, jtiBool, jtiNumeric, and jtiString.
Referenced by iterate_json_values().
|
static |
Definition at line 5051 of file jsonfuncs.c.
References Assert, fb(), JsonbIteratorNext(), pushJsonbValue(), WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_DONE, WJB_ELEM, WJB_END_ARRAY, and WJB_END_OBJECT.
Referenced by jsonb_concat().
Definition at line 3492 of file jsonfuncs.c.
References fb(), getKeyJsonValueFromContainer(), HASH_FIND, hash_search(), JsObject::is_json, JsObject::json_hash, JSON_TOKEN_NULL, JsObject::jsonb_cont, and JsObject::val.
Referenced by populate_record().
| Datum json_array_element | ( | PG_FUNCTION_ARGS | ) |
Definition at line 925 of file jsonfuncs.c.
References element(), fb(), get_worker(), PG_GETARG_INT32, PG_GETARG_TEXT_PP, PG_RETURN_NULL, and PG_RETURN_TEXT_P.
| Datum json_array_element_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 968 of file jsonfuncs.c.
References element(), fb(), get_worker(), PG_GETARG_INT32, PG_GETARG_TEXT_PP, PG_RETURN_NULL, and PG_RETURN_TEXT_P.
| Datum json_array_elements | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2296 of file jsonfuncs.c.
References elements_worker().
| Datum json_array_elements_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2302 of file jsonfuncs.c.
References elements_worker().
| Datum json_array_length | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1852 of file jsonfuncs.c.
References alen_array_element_start(), alen_object_start(), alen_scalar(), JsonSemAction::array_element_start, makeJsonLexContext(), JsonSemAction::object_start, palloc0_object, PG_GETARG_TEXT_PP, pg_parse_json_or_ereport, PG_RETURN_INT32, JsonSemAction::scalar, sem, and JsonSemAction::semstate.
| void json_categorize_type | ( | Oid | typoid, |
| bool | is_jsonb, | ||
| JsonTypeCategory * | tcategory, | ||
| Oid * | outfuncoid | ||
| ) |
Definition at line 5967 of file jsonfuncs.c.
References COERCION_EXPLICIT, COERCION_PATH_FUNC, fb(), find_coercion_pathway(), FirstNormalObjectId, get_element_type(), getBaseType(), getTypeOutputInfo(), InvalidOid, JSONTYPE_ARRAY, JSONTYPE_BOOL, JSONTYPE_CAST, JSONTYPE_COMPOSITE, JSONTYPE_DATE, JSONTYPE_JSON, JSONTYPE_JSONB, JSONTYPE_NUMERIC, JSONTYPE_OTHER, JSONTYPE_TIMESTAMP, JSONTYPE_TIMESTAMPTZ, OidIsValid, and type_is_rowtype().
Referenced by add_json(), add_jsonb(), array_to_json_internal(), array_to_jsonb_internal(), composite_to_json(), composite_to_jsonb(), ExecInitExprRec(), json_agg_transfn_worker(), json_check_mutability(), json_object_agg_transfn_worker(), jsonb_agg_transfn_worker(), jsonb_object_agg_transfn_worker(), to_json(), and to_jsonb().
Definition at line 6078 of file jsonfuncs.c.
References Assert, check_stack_depth(), fb(), func_volatile(), get_element_type(), get_multirange_range(), get_range_subtype(), get_typtype(), getBaseType(), i, json_categorize_type(), json_check_mutability(), JSONTYPE_ARRAY, JSONTYPE_BOOL, JSONTYPE_CAST, JSONTYPE_COMPOSITE, JSONTYPE_DATE, JSONTYPE_JSON, JSONTYPE_JSONB, JSONTYPE_NULL, JSONTYPE_NUMERIC, JSONTYPE_OTHER, JSONTYPE_TIMESTAMP, JSONTYPE_TIMESTAMPTZ, lookup_rowtype_tupdesc(), TupleDescData::natts, OidIsValid, ReleaseTupleDesc, and TupleDescAttr().
Referenced by json_check_mutability(), to_json_is_immutable(), and to_jsonb_is_immutable().
| Datum json_each | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1950 of file jsonfuncs.c.
References each_worker().
| Datum json_each_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1962 of file jsonfuncs.c.
References each_worker().
| void json_errsave_error | ( | JsonParseErrorType | error, |
| JsonLexContext * | lex, | ||
| Node * | escontext | ||
| ) |
Definition at line 644 of file jsonfuncs.c.
References elog, errcode(), errdetail_internal(), errmsg, ERROR, error(), errsave, fb(), 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().
| Datum json_extract_path | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1012 of file jsonfuncs.c.
References get_path_all().
| Datum json_extract_path_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1018 of file jsonfuncs.c.
References get_path_all().
| JsonTokenType json_get_first_token | ( | text * | json, |
| bool | throw_error | ||
| ) |
Definition at line 5940 of file jsonfuncs.c.
References fb(), json_errsave_error(), json_lex(), JSON_SUCCESS, JSON_TOKEN_INVALID, makeJsonLexContext(), and JsonLexContext::token_type.
Referenced by ExecEvalJsonIsPredicate().
| Datum json_object_field | ( | PG_FUNCTION_ARGS | ) |
Definition at line 849 of file jsonfuncs.c.
References fb(), get_worker(), PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, and text_to_cstring().
| Datum json_object_field_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 887 of file jsonfuncs.c.
References fb(), get_worker(), PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, and text_to_cstring().
| Datum json_object_keys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 735 of file jsonfuncs.c.
References JsonSemAction::array_start, CStringGetTextDatum, fb(), freeJsonLexContext(), makeJsonLexContext(), MemoryContextSwitchTo(), JsonSemAction::object_field_start, okeys_array_start(), okeys_object_field_start(), okeys_scalar(), palloc0_object, palloc_array, palloc_object, pfree(), PG_GETARG_TEXT_PP, pg_parse_json_or_ereport, JsonSemAction::scalar, sem, JsonSemAction::semstate, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, and SRF_RETURN_NEXT.
| Datum json_populate_record | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2495 of file jsonfuncs.c.
References fb(), and populate_record_worker().
| Datum json_populate_recordset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3988 of file jsonfuncs.c.
References populate_recordset_worker().
| Datum json_populate_type | ( | Datum | json_val, |
| Oid | json_type, | ||
| Oid | typid, | ||
| int32 | typmod, | ||
| void ** | cache, | ||
| MemoryContext | mcxt, | ||
| bool * | isnull, | ||
| bool | omit_quotes, | ||
| Node * | escontext | ||
| ) |
Definition at line 3345 of file jsonfuncs.c.
References DatumGetJsonbP(), DatumGetTextPP, fb(), jbvBinary, jbvString, JSON_TOKEN_INVALID, JsonbUnquote(), MemoryContextAllocZero(), PointerGetDatum(), populate_record_field(), Jsonb::root, str, JsonbValue::val, VARDATA_ANY(), VARHDRSZ, VARSIZE(), and VARSIZE_ANY_EXHDR().
Referenced by ExecEvalJsonCoercion().
| Datum json_strip_nulls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4505 of file jsonfuncs.c.
References JsonSemAction::array_element_start, JsonSemAction::array_end, JsonSemAction::array_start, cstring_to_text_with_len(), fb(), initStringInfo(), makeJsonLexContext(), JsonSemAction::object_end, JsonSemAction::object_field_start, JsonSemAction::object_start, palloc0_object, PG_GETARG_BOOL, PG_GETARG_TEXT_PP, PG_NARGS, pg_parse_json_or_ereport, PG_RETURN_TEXT_P, JsonSemAction::scalar, sem, JsonSemAction::semstate, sn_array_element_start(), sn_array_end(), sn_array_start(), sn_object_end(), sn_object_field_start(), sn_object_start(), and sn_scalar().
| Datum json_to_record | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2502 of file jsonfuncs.c.
References fb(), and populate_record_worker().
| Datum json_to_recordset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3995 of file jsonfuncs.c.
References populate_recordset_worker().
| Datum jsonb_array_element | ( | PG_FUNCTION_ARGS | ) |
Definition at line 940 of file jsonfuncs.c.
References element(), fb(), getIthJsonbValueFromContainer(), JB_ROOT_COUNT, JB_ROOT_IS_ARRAY, JsonbValueToJsonb(), pg_abs_s32(), PG_GETARG_INT32, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, and PG_RETURN_NULL.
| Datum jsonb_array_element_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 983 of file jsonfuncs.c.
References element(), fb(), getIthJsonbValueFromContainer(), JB_ROOT_COUNT, JB_ROOT_IS_ARRAY, jbvNull, JsonbValueAsText(), pg_abs_s32(), PG_GETARG_INT32, PG_GETARG_JSONB_P, PG_RETURN_NULL, PG_RETURN_TEXT_P, and JsonbValue::type.
| Datum jsonb_array_elements | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2208 of file jsonfuncs.c.
References elements_worker_jsonb().
| Datum jsonb_array_elements_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2214 of file jsonfuncs.c.
References elements_worker_jsonb().
| Datum jsonb_array_length | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1878 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JB_ROOT_COUNT, JB_ROOT_IS_ARRAY, JB_ROOT_IS_SCALAR, PG_GETARG_JSONB_P, and PG_RETURN_INT32.
| Datum jsonb_concat | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4623 of file jsonfuncs.c.
References fb(), IteratorConcat(), JB_ROOT_COUNT, JB_ROOT_IS_OBJECT, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbValueToJsonb(), PG_GETARG_JSONB_P, and PG_RETURN_JSONB_P.
| Datum jsonb_delete | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4661 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JB_ROOT_COUNT, JB_ROOT_IS_SCALAR, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), PG_GETARG_JSONB_P, PG_GETARG_TEXT_PP, PG_RETURN_JSONB_P, pushJsonbValue(), JsonbInState::result, Jsonb::root, JsonbValue::type, JsonbValue::val, VARDATA_ANY(), VARSIZE_ANY_EXHDR(), WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, and WJB_KEY.
| Datum jsonb_delete_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4711 of file jsonfuncs.c.
References ARR_NDIM, DatumGetPointer(), deconstruct_array_builtin(), ereport, errcode(), errmsg, ERROR, fb(), i, JB_ROOT_COUNT, JB_ROOT_IS_SCALAR, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, pushJsonbValue(), JsonbInState::result, Jsonb::root, JsonbValue::type, JsonbValue::val, VARDATA_ANY(), VARSIZE_ANY_EXHDR(), WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, and WJB_KEY.
| Datum jsonb_delete_idx | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4795 of file jsonfuncs.c.
References Assert, ereport, errcode(), errmsg, ERROR, fb(), i, idx(), JB_ROOT_COUNT, JB_ROOT_IS_OBJECT, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), pg_abs_s32(), PG_GETARG_INT32, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, pushJsonbValue(), JsonbInState::result, Jsonb::root, JsonbValue::val, WJB_BEGIN_ARRAY, WJB_DONE, and WJB_ELEM.
| Datum jsonb_delete_path | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4965 of file jsonfuncs.c.
References ARR_NDIM, deconstruct_array_builtin(), ereport, errcode(), errmsg, ERROR, fb(), JB_PATH_DELETE, JB_ROOT_COUNT, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbValueToJsonb(), PG_GETARG_ARRAYTYPE_P, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, JsonbInState::result, Jsonb::root, and setPath().
Referenced by jsonb_set_lax().
| Datum jsonb_each | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1956 of file jsonfuncs.c.
References each_worker_jsonb().
| Datum jsonb_each_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1968 of file jsonfuncs.c.
References each_worker_jsonb().
| Datum jsonb_extract_path | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1491 of file jsonfuncs.c.
References get_jsonb_path_all().
| Datum jsonb_extract_path_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1497 of file jsonfuncs.c.
References get_jsonb_path_all().
Definition at line 1534 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().
| Datum jsonb_insert | ( | PG_FUNCTION_ARGS | ) |
Definition at line 5005 of file jsonfuncs.c.
References ARR_NDIM, deconstruct_array_builtin(), ereport, errcode(), errmsg, ERROR, fb(), JB_PATH_INSERT_AFTER, JB_PATH_INSERT_BEFORE, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbToJsonbValue(), JsonbValueToJsonb(), newval, PG_GETARG_ARRAYTYPE_P, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, JsonbInState::result, Jsonb::root, and setPath().
| Datum jsonb_object_field | ( | PG_FUNCTION_ARGS | ) |
Definition at line 865 of file jsonfuncs.c.
References fb(), getKeyJsonValueFromContainer(), JB_ROOT_IS_OBJECT, JsonbValueToJsonb(), PG_GETARG_JSONB_P, PG_GETARG_TEXT_PP, PG_RETURN_JSONB_P, PG_RETURN_NULL, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum jsonb_object_field_text | ( | PG_FUNCTION_ARGS | ) |
Definition at line 903 of file jsonfuncs.c.
References fb(), getKeyJsonValueFromContainer(), JB_ROOT_IS_OBJECT, jbvNull, JsonbValueAsText(), PG_GETARG_JSONB_P, PG_GETARG_TEXT_PP, PG_RETURN_NULL, PG_RETURN_TEXT_P, JsonbValue::type, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
| Datum jsonb_object_keys | ( | PG_FUNCTION_ARGS | ) |
Definition at line 571 of file jsonfuncs.c.
References CStringGetTextDatum, ereport, errcode(), errmsg, ERROR, fb(), JB_ROOT_COUNT, JB_ROOT_IS_ARRAY, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbIteratorNext(), MemoryContextSwitchTo(), palloc(), palloc_array, palloc_object, PG_GETARG_JSONB_P, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, JsonbValue::val, WJB_DONE, and WJB_KEY.
| Datum jsonb_populate_record | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2464 of file jsonfuncs.c.
References fb(), and populate_record_worker().
| Datum jsonb_populate_record_valid | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2477 of file jsonfuncs.c.
References BoolGetDatum(), ErrorSaveContext::error_occurred, fb(), and populate_record_worker().
| Datum jsonb_populate_recordset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3974 of file jsonfuncs.c.
References populate_recordset_worker().
| Datum jsonb_pretty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4606 of file jsonfuncs.c.
References cstring_to_text_with_len(), fb(), initStringInfo(), JsonbToCStringIndent(), PG_GETARG_JSONB_P, PG_RETURN_TEXT_P, str, and VARSIZE().
| Datum jsonb_set | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4856 of file jsonfuncs.c.
References ARR_NDIM, deconstruct_array_builtin(), ereport, errcode(), errmsg, ERROR, fb(), JB_PATH_CREATE, JB_PATH_REPLACE, JB_ROOT_COUNT, JB_ROOT_IS_SCALAR, JsonbIteratorInit(), JsonbToJsonbValue(), JsonbValueToJsonb(), newval, PG_GETARG_ARRAYTYPE_P, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_RETURN_JSONB_P, JsonbInState::result, Jsonb::root, and setPath().
Referenced by jsonb_set_lax().
Definition at line 1682 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().
| Datum jsonb_set_lax | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4902 of file jsonfuncs.c.
References CStringGetDatum(), DirectFunctionCall1, ereport, errcode(), errdetail(), errhint(), errmsg, ERROR, fb(), jsonb_delete_path(), jsonb_in(), jsonb_set(), newval, PG_ARGISNULL, PG_GETARG_JSONB_P, PG_GETARG_TEXT_P, PG_RETURN_JSONB_P, PG_RETURN_NULL, and text_to_cstring().
| Datum jsonb_strip_nulls | ( | PG_FUNCTION_ARGS | ) |
Definition at line 4542 of file jsonfuncs.c.
References Assert, fb(), JB_ROOT_IS_SCALAR, jbvNull, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_NARGS, PG_RETURN_POINTER, pushJsonbValue(), JsonbInState::result, type, JsonbValue::type, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
| Datum jsonb_to_record | ( | PG_FUNCTION_ARGS | ) |
Definition at line 2488 of file jsonfuncs.c.
References fb(), and populate_record_worker().
| Datum jsonb_to_recordset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 3981 of file jsonfuncs.c.
References populate_recordset_worker().
|
static |
Definition at line 1805 of file jsonfuncs.c.
References cstring_to_text(), cstring_to_text_with_len(), DatumGetCString(), DirectFunctionCall1, elog, ERROR, fb(), initStringInfo(), jbvBinary, jbvBool, jbvNull, jbvNumeric, jbvString, JsonbToCString(), numeric_out(), PointerGetDatum(), JsonbValue::type, and JsonbValue::val.
Referenced by each_worker_jsonb(), elements_worker_jsonb(), jsonb_array_element_text(), jsonb_get_element(), and jsonb_object_field_text().
Definition at line 2982 of file jsonfuncs.c.
References Assert, errcode(), errmsg, errsave, fb(), get_json_object_as_hash(), IsAJsonbScalar, jbvBinary, JsonContainerIsObject, JsonContainerIsScalar, SOFT_ERROR_OCCURRED, and JsonbValue::val.
Referenced by populate_composite().
| JsonLexContext * makeJsonLexContext | ( | JsonLexContext * | lex, |
| text * | json, | ||
| bool | need_escapes | ||
| ) |
Definition at line 543 of file jsonfuncs.c.
References GetDatabaseEncoding(), makeJsonLexContextCstringLen(), pg_detoast_datum_packed(), VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by datum_to_jsonb_internal(), 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().
|
static |
Definition at line 812 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by json_object_keys().
|
static |
Definition at line 789 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, pstrdup(), and repalloc().
Referenced by json_object_keys().
|
static |
Definition at line 827 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), and JSON_SUCCESS.
Referenced by json_object_keys().
Definition at line 5562 of file jsonfuncs.c.
References elog, ereport, errcode(), errhint(), errmsg, ERROR, fb(), jbvString, JsonbIteratorInit(), JsonbIteratorNext(), jtiAll, jtiBool, jtiKey, jtiNumeric, jtiString, pg_strncasecmp(), pnstrdup(), 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, |
| const JsonSemAction * | sem, | ||
| Node * | escontext | ||
| ) |
Definition at line 522 of file jsonfuncs.c.
References json_errsave_error(), JSON_SUCCESS, pg_parse_json(), and sem.
Referenced by get_json_object_as_hash(), json_in(), jsonb_from_cstring(), and populate_array_json().
|
static |
Definition at line 2915 of file jsonfuncs.c.
References PopulateArrayContext::acxt, PopulateArrayContext::aio, Assert, PopulateArrayContext::astate, PopulateArrayContext::colname, CurrentMemoryContext, PopulateArrayContext::dims, ArrayIOData::element_type, PopulateArrayContext::escontext, fb(), i, initArrayResult(), makeMdArrayResult(), PopulateArrayContext::mcxt, PopulateArrayContext::ndims, palloc_array, pfree(), populate_array_dim_jsonb(), populate_array_json(), and PopulateArrayContext::sizes.
Referenced by populate_record_field().
|
static |
Definition at line 2668 of file jsonfuncs.c.
References fb(), JSON_SEM_ACTION_FAILED, JSON_SUCCESS, PopulateArrayContext::ndims, populate_array_assign_ndims(), and populate_array_check_dimension().
Referenced by populate_array_json().
|
static |
Definition at line 2560 of file jsonfuncs.c.
References Assert, PopulateArrayContext::dims, PopulateArrayContext::escontext, i, PopulateArrayContext::ndims, palloc0_array, palloc_array, populate_array_report_expected_array(), PopulateArrayContext::sizes, and SOFT_ERROR_OCCURRED.
Referenced by populate_array_array_end(), populate_array_dim_jsonb(), populate_array_object_start(), and populate_array_scalar().
|
static |
Definition at line 2590 of file jsonfuncs.c.
References PopulateArrayContext::dims, ereturn, errcode(), errdetail(), errmsg, PopulateArrayContext::escontext, fb(), and PopulateArrayContext::sizes.
Referenced by populate_array_array_end(), and populate_array_dim_jsonb().
|
static |
Definition at line 2825 of file jsonfuncs.c.
References Assert, check_stack_depth(), PopulateArrayContext::dims, PopulateArrayContext::escontext, fb(), jbvBinary, JsonbIteratorInit(), JsonbIteratorNext(), JsonContainerIsArray, JsonContainerIsScalar, PopulateArrayContext::ndims, populate_array_assign_ndims(), populate_array_check_dimension(), populate_array_dim_jsonb(), populate_array_element(), populate_array_report_expected_array(), SOFT_ERROR_OCCURRED, val, WJB_BEGIN_ARRAY, WJB_DONE, WJB_ELEM, and WJB_END_ARRAY.
Referenced by populate_array(), and populate_array_dim_jsonb().
|
static |
Definition at line 2618 of file jsonfuncs.c.
References accumArrayResult(), PopulateArrayContext::acxt, PopulateArrayContext::aio, Assert, PopulateArrayContext::astate, element(), ArrayIOData::element_info, ArrayIOData::element_type, ArrayIOData::element_typmod, PopulateArrayContext::escontext, fb(), PopulateArrayContext::mcxt, PointerGetDatum(), populate_record_field(), PopulateArrayContext::sizes, and SOFT_ERROR_OCCURRED.
Referenced by populate_array_dim_jsonb(), and populate_array_element_end().
|
static |
Definition at line 2710 of file jsonfuncs.c.
References Assert, fb(), JsValue::is_json, JSON_SEM_ACTION_FAILED, JSON_SUCCESS, JSON_TOKEN_NULL, PopulateArrayContext::ndims, and populate_array_element().
Referenced by populate_array_json().
|
static |
Definition at line 2692 of file jsonfuncs.c.
References fb(), and JSON_SUCCESS.
Referenced by populate_array_json().
Definition at line 2789 of file jsonfuncs.c.
References JsonSemAction::array_element_end, JsonSemAction::array_element_start, JsonSemAction::array_end, Assert, PopulateArrayContext::dims, PopulateArrayContext::escontext, fb(), freeJsonLexContext(), GetDatabaseEncoding(), len, makeJsonLexContextCstringLen(), PopulateArrayContext::ndims, JsonSemAction::object_start, pg_parse_json_or_errsave(), populate_array_array_end(), populate_array_element_end(), populate_array_element_start(), populate_array_object_start(), populate_array_scalar(), JsonSemAction::scalar, sem, JsonSemAction::semstate, and SOFT_ERROR_OCCURRED.
Referenced by populate_array().
|
static |
Definition at line 2645 of file jsonfuncs.c.
References Assert, fb(), JSON_SEM_ACTION_FAILED, JSON_SUCCESS, populate_array_assign_ndims(), populate_array_report_expected_array(), and SOFT_ERROR_OCCURRED.
Referenced by populate_array_json().
|
static |
Definition at line 2510 of file jsonfuncs.c.
References appendStringInfo(), Assert, PopulateArrayContext::colname, StringInfoData::data, errcode(), errhint(), errmsg, errsave, PopulateArrayContext::escontext, fb(), i, initStringInfo(), PopulateArrayContext::ndims, and PopulateArrayContext::sizes.
Referenced by populate_array_assign_ndims(), populate_array_dim_jsonb(), populate_array_object_start(), and populate_array_scalar().
|
static |
Definition at line 2753 of file jsonfuncs.c.
References Assert, PopulateArrayContext::escontext, fb(), JSON_SEM_ACTION_FAILED, JSON_SUCCESS, PopulateArrayContext::ndims, populate_array_assign_ndims(), populate_array_report_expected_array(), SOFT_ERROR_OCCURRED, and token.
Referenced by populate_array_json().
|
static |
Definition at line 3058 of file jsonfuncs.c.
References CompositeIOData::base_typid, domain_check_safe(), CompositeIOData::domain_info, fb(), HeapTupleHeaderGetDatum(), JsObjectFree, JsValueToJsObject(), populate_record(), CompositeIOData::record_io, SOFT_ERROR_OCCURRED, CompositeIOData::tupdesc, and update_cached_tupdesc().
Referenced by populate_record_field(), and populate_record_worker().
|
static |
Definition at line 3217 of file jsonfuncs.c.
References Assert, DomainIOData::base_io, DomainIOData::base_typid, DomainIOData::base_typmod, domain_check_safe(), DomainIOData::domain_info, fb(), PointerGetDatum(), populate_record_field(), and SOFT_ERROR_OCCURRED.
Referenced by populate_record_field().
|
static |
Definition at line 3520 of file jsonfuncs.c.
References allocate_record_info(), RecordIOData::columns, fb(), heap_deform_tuple(), heap_form_tuple(), HeapTupleHeaderGetDatumLength(), i, InvalidOid, ItemPointerSetInvalid(), JsObjectGetField(), JsObjectIsEmpty, MemSet, NameStr, TupleDescData::natts, RecordIOData::ncolumns, palloc(), pfree(), populate_record_field(), RecordIOData::record_type, RecordIOData::record_typmod, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, TupleDescData::tdtypeid, TupleDescData::tdtypmod, TupleDescAttr(), and values.
Referenced by populate_composite(), and populate_recordset_record().
|
static |
Definition at line 3406 of file jsonfuncs.c.
References check_stack_depth(), DatumGetHeapTupleHeader, DatumGetPointer(), elog, ERROR, fb(), JsValueIsNull, JsValueIsString, populate_array(), populate_composite(), populate_domain(), populate_scalar(), prepare_column_cache(), TYPECAT_ARRAY, TYPECAT_COMPOSITE, TYPECAT_COMPOSITE_DOMAIN, TYPECAT_DOMAIN, and TYPECAT_SCALAR.
Referenced by json_populate_type(), populate_array_element(), populate_domain(), and populate_record().
|
static |
Definition at line 3699 of file jsonfuncs.c.
References PopulateRecordCache::argtype, Assert, CompositeIOData::base_typid, CompositeIOData::base_typmod, PopulateRecordCache::c, ColumnIOData::composite, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, PopulateRecordCache::fn_mcxt, FmgrInfo::fn_mcxt, funcname, get_record_type_from_argument(), get_record_type_from_query(), HeapTupleHeaderGetTypeId(), HeapTupleHeaderGetTypMod(), ColumnIOData::io, jbvBinary, JSON_TOKEN_INVALID, MemoryContextAllocZero(), PG_ARGISNULL, PG_GETARG_HEAPTUPLEHEADER, PG_GETARG_JSONB_P, PG_GETARG_TEXT_PP, PG_RETURN_DATUM, PG_RETURN_NULL, PG_RETURN_POINTER, populate_composite(), SOFT_ERROR_OCCURRED, VARDATA_ANY(), VARHDRSZ, VARSIZE(), and VARSIZE_ANY_EXHDR().
Referenced by json_populate_record(), json_to_record(), jsonb_populate_record(), jsonb_populate_record_valid(), and jsonb_to_record().
|
static |
Definition at line 4268 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JSON_SUCCESS, and JSON_TOKEN_OBJECT_START.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4283 of file jsonfuncs.c.
References JSON_SUCCESS.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4245 of file jsonfuncs.c.
References fb(), hash_destroy(), JsObject::is_json, JsObject::json_hash, JSON_SUCCESS, populate_recordset_record(), and JsObject::val.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4330 of file jsonfuncs.c.
References Assert, fb(), HASH_ENTER, hash_search(), JSON_SUCCESS, JSON_TOKEN_NULL, len, NAMEDATALEN, palloc(), and val.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4307 of file jsonfuncs.c.
References fb(), JSON_SUCCESS, JSON_TOKEN_ARRAY_START, and JSON_TOKEN_OBJECT_START.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4215 of file jsonfuncs.c.
References ctl, CurrentMemoryContext, ereport, errcode(), errmsg, ERROR, fb(), HASH_CONTEXT, hash_create(), HASH_ELEM, HASH_STRINGS, JSON_SUCCESS, and NAMEDATALEN.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4002 of file jsonfuncs.c.
References PopulateRecordCache::argtype, PopulateRecordCache::c, ColumnIOData::composite, domain_check_safe(), CompositeIOData::domain_info, fb(), PopulateRecordCache::fn_mcxt, HeapTupleHeaderGetDatum(), HeapTupleHeaderGetDatumLength(), InvalidOid, ColumnIOData::io, ItemPointerSetInvalid(), populate_record(), CompositeIOData::record_io, HeapTupleData::t_data, HeapTupleData::t_len, HeapTupleData::t_self, HeapTupleData::t_tableOid, CompositeIOData::tupdesc, tuplestore_puttuple(), ColumnIOData::typcat, TYPECAT_COMPOSITE_DOMAIN, and update_cached_tupdesc().
Referenced by populate_recordset_object_end(), and populate_recordset_worker().
|
static |
Definition at line 4290 of file jsonfuncs.c.
References ereport, errcode(), errmsg, ERROR, fb(), JSON_SUCCESS, and token.
Referenced by populate_recordset_worker().
|
static |
Definition at line 4041 of file jsonfuncs.c.
References ReturnSetInfo::allowedModes, PopulateRecordCache::argtype, JsonSemAction::array_element_start, JsonSemAction::array_start, Assert, CompositeIOData::base_typid, CompositeIOData::base_typmod, PopulateRecordCache::c, ColumnIOData::composite, CreateTupleDescCopy(), ReturnSetInfo::econtext, ExprContext::ecxt_per_query_memory, ereport, errcode(), errmsg, ERROR, fb(), FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, PopulateRecordCache::fn_mcxt, FmgrInfo::fn_mcxt, freeJsonLexContext(), funcname, get_record_type_from_argument(), get_record_type_from_query(), HeapTupleHeaderGetTypeId(), HeapTupleHeaderGetTypMod(), ColumnIOData::io, JsObject::is_json, IsA, JB_ROOT_IS_ARRAY, JB_ROOT_IS_SCALAR, jbvBinary, JsObject::jsonb_cont, JsonbIteratorInit(), JsonbIteratorNext(), JsonContainerIsObject, makeJsonLexContext(), MemoryContextAllocZero(), MemoryContextSwitchTo(), JsonSemAction::object_end, JsonSemAction::object_field_end, JsonSemAction::object_field_start, JsonSemAction::object_start, palloc0_object, PG_ARGISNULL, PG_GETARG_HEAPTUPLEHEADER, PG_GETARG_JSONB_P, PG_GETARG_TEXT_PP, pg_parse_json_or_ereport, PG_RETURN_NULL, populate_recordset_array_element_start(), populate_recordset_array_start(), populate_recordset_object_end(), populate_recordset_object_field_end(), populate_recordset_object_field_start(), populate_recordset_object_start(), populate_recordset_record(), populate_recordset_scalar(), FunctionCallInfoBaseData::resultinfo, ReturnSetInfo::returnMode, JsonSemAction::scalar, sem, JsonSemAction::semstate, ReturnSetInfo::setDesc, ReturnSetInfo::setResult, SFRM_Materialize, SFRM_Materialize_Random, CompositeIOData::tupdesc, tuplestore_begin_heap(), JsonbValue::type, update_cached_tupdesc(), JsObject::val, JsonbValue::val, WJB_DONE, WJB_ELEM, and work_mem.
Referenced by json_populate_recordset(), json_to_recordset(), jsonb_populate_recordset(), and jsonb_to_recordset().
|
static |
Definition at line 3125 of file jsonfuncs.c.
References Assert, buf, DatumGetCString(), DirectFunctionCall1, elog, ERROR, escape_json(), escape_json_with_len(), fb(), initStringInfo(), InputFunctionCallSafe(), jbvBinary, jbvBool, jbvNumeric, jbvString, JSON_TOKEN_STRING, JsonbPGetDatum(), JsonbToCString(), JsonbValueToJsonb(), len, numeric_out(), palloc(), pfree(), pnstrdup(), PointerGetDatum(), pstrdup(), Jsonb::root, str, ScalarIOData::typiofunc, ScalarIOData::typioparam, unconstify, JsonbValue::val, and VARSIZE().
Referenced by populate_record_field().
|
static |
Definition at line 3251 of file jsonfuncs.c.
References elog, ERROR, fb(), fmgr_info_cxt(), Form_pg_type, get_typtype(), getBaseTypeAndTypmod(), GETSTRUCT(), getTypeInputInfo(), HeapTupleIsValid, MemoryContextAllocZero(), ObjectIdGetDatum(), ReleaseSysCache(), SearchSysCache1(), type, TYPECAT_ARRAY, TYPECAT_COMPOSITE, TYPECAT_COMPOSITE_DOMAIN, TYPECAT_DOMAIN, and TYPECAT_SCALAR.
Referenced by get_record_type_from_argument(), and populate_record_field().
|
static |
Definition at line 1704 of file jsonfuncs.c.
References fb(), jbvNull, ps, pushJsonbValue(), JsonbValue::type, and WJB_ELEM.
Referenced by push_path(), and setPathArray().
|
static |
Definition at line 1723 of file jsonfuncs.c.
References fb(), i, jbvArray, jbvObject, jbvString, newval, palloc0_array, push_null_elements(), pushJsonbValue(), strtoint(), TextDatumGetCString, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_ELEM, WJB_END_ARRAY, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by setPathArray(), and setPathObject().
|
static |
Definition at line 680 of file jsonfuncs.c.
References Assert, errcontext, fb(), JsonLexContext::input, JsonLexContext::input_length, IS_HIGHBIT_SET, JSON_TOKEN_END, JsonLexContext::line_number, JsonLexContext::line_start, palloc(), pg_mblen_range(), JsonLexContext::token_terminator, and JsonLexContext::token_type.
Referenced by json_errsave_error().
|
static |
Definition at line 5176 of file jsonfuncs.c.
References Assert, check_stack_depth(), elog, ereport, errcode(), errdetail(), errmsg, ERROR, fb(), JB_PATH_FILL_GAPS, JsonbIteratorNext(), newval, pushJsonbValue(), setPathArray(), setPathObject(), JsonbValue::val, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_ELEM, WJB_END_ARRAY, WJB_END_OBJECT, and WJB_VALUE.
Referenced by jsonb_delete_path(), jsonb_insert(), jsonb_set(), jsonb_set_element(), setPathArray(), and setPathObject().
|
static |
Definition at line 5392 of file jsonfuncs.c.
References Assert, ereport, errcode(), errmsg, ERROR, fb(), i, idx(), JB_PATH_CONSISTENT_POSITION, JB_PATH_CREATE, JB_PATH_CREATE_OR_INSERT, JB_PATH_FILL_GAPS, JB_PATH_INSERT_AFTER, JB_PATH_INSERT_BEFORE, JB_PATH_REPLACE, JsonbIteratorNext(), newval, pg_abs_s32(), PG_INT32_MIN, push_null_elements(), push_path(), pushJsonbValue(), setPath(), strtoint(), TextDatumGetCString, WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_ELEM, WJB_END_ARRAY, and WJB_END_OBJECT.
Referenced by setPath().
|
static |
Definition at line 5254 of file jsonfuncs.c.
References Assert, DatumGetTextPP, ereport, errcode(), errhint(), errmsg, ERROR, fb(), i, JB_PATH_CREATE_OR_INSERT, JB_PATH_DELETE, JB_PATH_FILL_GAPS, JB_PATH_INSERT_AFTER, JB_PATH_INSERT_BEFORE, jbvString, JsonbIteratorNext(), newval, push_path(), pushJsonbValue(), setPath(), JsonbValue::type, JsonbValue::val, VARDATA_ANY(), VARSIZE_ANY_EXHDR(), WJB_BEGIN_ARRAY, WJB_BEGIN_OBJECT, WJB_END_ARRAY, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by setPath().
|
static |
Definition at line 4460 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4420 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4410 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4400 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4430 of file jsonfuncs.c.
References appendStringInfoCharMacro, escape_json(), fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4390 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by json_strip_nulls().
|
static |
Definition at line 4482 of file jsonfuncs.c.
References appendStringInfoString(), Assert, escape_json(), fb(), JSON_SUCCESS, JSON_TOKEN_NULL, and JSON_TOKEN_STRING.
Referenced by json_strip_nulls().
| text * transform_json_string_values | ( | text * | json, |
| void * | action_state, | ||
| JsonTransformStringValuesAction | transform_action | ||
| ) |
Definition at line 5818 of file jsonfuncs.c.
References JsonSemAction::array_element_start, JsonSemAction::array_end, JsonSemAction::array_start, cstring_to_text_with_len(), fb(), freeJsonLexContext(), initStringInfo(), makeJsonLexContext(), JsonSemAction::object_end, JsonSemAction::object_field_start, JsonSemAction::object_start, palloc0_object, pg_parse_json_or_ereport, JsonSemAction::scalar, sem, 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 5772 of file jsonfuncs.c.
References fb(), jbvArray, jbvString, JsonbIteratorInit(), JsonbIteratorNext(), JsonbValueToJsonb(), pg_detoast_datum_packed(), pushJsonbValue(), JsonbInState::result, Jsonb::root, 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().
|
static |
Definition at line 5912 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5884 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5874 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5864 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5894 of file jsonfuncs.c.
References appendStringInfoCharMacro, escape_json(), fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5854 of file jsonfuncs.c.
References appendStringInfoCharMacro, fb(), and JSON_SUCCESS.
Referenced by transform_json_string_values().
|
static |
Definition at line 5923 of file jsonfuncs.c.
References appendStringInfoString(), escape_json_text(), fb(), JSON_SUCCESS, and JSON_TOKEN_STRING.
Referenced by transform_json_string_values().
|
static |
Definition at line 3029 of file jsonfuncs.c.
References CompositeIOData::base_typid, CompositeIOData::base_typmod, CreateTupleDescCopy(), fb(), FreeTupleDesc(), lookup_rowtype_tupdesc(), MemoryContextSwitchTo(), ReleaseTupleDesc, TupleDescData::tdtypeid, TupleDescData::tdtypmod, and CompositeIOData::tupdesc.
Referenced by populate_composite(), populate_recordset_record(), and populate_recordset_worker().