|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "catalog/pg_collation.h"#include "catalog/pg_type.h"#include "funcapi.h"#include "miscadmin.h"#include "nodes/miscnodes.h"#include "nodes/nodeFuncs.h"#include "regex/regex.h"#include "utils/builtins.h"#include "utils/date.h"#include "utils/datetime.h"#include "utils/float.h"#include "utils/formatting.h"#include "utils/json.h"#include "utils/jsonpath.h"#include "utils/memutils.h"#include "utils/timestamp.h"
Go to the source code of this file.
Data Structures | |
| struct | JsonBaseObjectInfo |
| struct | JsonPathExecContext |
| struct | JsonLikeRegexContext |
| struct | JsonValueList |
| struct | JsonValueListIterator |
| struct | JsonTablePlanRowSource |
| struct | JsonTablePlanState |
| struct | JsonTableExecContext |
Macros | |
| #define | jperIsError(jper) ((jper) == jperError) |
| #define | BASE_JVL_ITEMS 2 /* number of items a base chunk holds */ |
| #define | MIN_EXTRA_JVL_ITEMS 16 /* min number of items an extra chunk holds */ |
| #define | JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867 |
| #define | jspStrictAbsenceOfErrors(cxt) (!(cxt)->laxMode) |
| #define | jspAutoUnwrap(cxt) ((cxt)->laxMode) |
| #define | jspAutoWrap(cxt) ((cxt)->laxMode) |
| #define | jspIgnoreStructuralErrors(cxt) ((cxt)->ignoreStructuralErrors) |
| #define | jspThrowErrors(cxt) ((cxt)->throwErrors) |
| #define | RETURN_ERROR(throw_error) |
Typedefs | |
| typedef struct JsonBaseObjectInfo | JsonBaseObjectInfo |
| typedef JsonbValue *(* | JsonPathGetVarCallback) (void *vars, char *varName, int varNameLen, JsonbValue *baseObject, int *baseObjectId) |
| typedef int(* | JsonPathCountVarsCallback) (void *vars) |
| typedef struct JsonPathExecContext | JsonPathExecContext |
| typedef struct JsonLikeRegexContext | JsonLikeRegexContext |
| typedef enum JsonPathBool | JsonPathBool |
| typedef enum JsonPathExecResult | JsonPathExecResult |
| typedef struct JsonValueList | JsonValueList |
| typedef struct JsonValueListIterator | JsonValueListIterator |
| typedef struct JsonTablePlanRowSource | JsonTablePlanRowSource |
| typedef struct JsonTablePlanState | JsonTablePlanState |
| typedef struct JsonTableExecContext | JsonTableExecContext |
| typedef JsonPathBool(* | JsonPathPredicateCallback) (JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param) |
| typedef Numeric(* | BinaryArithmFunc) (Numeric num1, Numeric num2, Node *escontext) |
Enumerations | |
| enum | JsonPathBool { jpbFalse = 0 , jpbTrue = 1 , jpbUnknown = 2 } |
| enum | JsonPathExecResult { jperOk = 0 , jperNotFound = 1 , jperError = 2 } |
Variables | |
| const TableFuncRoutine | JsonbTableRoutine |
Definition at line 168 of file jsonpath_exec.c.
| #define JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867 |
Definition at line 246 of file jsonpath_exec.c.
| #define jspAutoUnwrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 264 of file jsonpath_exec.c.
| #define jspAutoWrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 265 of file jsonpath_exec.c.
| #define jspIgnoreStructuralErrors | ( | cxt | ) | ((cxt)->ignoreStructuralErrors) |
Definition at line 266 of file jsonpath_exec.c.
| #define jspStrictAbsenceOfErrors | ( | cxt | ) | (!(cxt)->laxMode) |
Definition at line 263 of file jsonpath_exec.c.
| #define jspThrowErrors | ( | cxt | ) | ((cxt)->throwErrors) |
Definition at line 267 of file jsonpath_exec.c.
Definition at line 169 of file jsonpath_exec.c.
| #define RETURN_ERROR | ( | throw_error | ) |
Definition at line 270 of file jsonpath_exec.c.
Definition at line 282 of file jsonpath_exec.c.
Definition at line 91 of file jsonpath_exec.c.
| typedef JsonbValue *(* JsonPathGetVarCallback) (void *vars, char *varName, int varNameLen, JsonbValue *baseObject, int *baseObjectId) |
Definition at line 89 of file jsonpath_exec.c.
| typedef JsonPathBool(* JsonPathPredicateCallback) (JsonPathItem *jsp, JsonbValue *larg, JsonbValue *rarg, void *param) |
Definition at line 278 of file jsonpath_exec.c.
| typedef struct JsonValueList JsonValueList |
| Enumerator | |
|---|---|
| jpbFalse | |
| jpbTrue | |
| jpbUnknown | |
Definition at line 127 of file jsonpath_exec.c.
| Enumerator | |
|---|---|
| jperOk | |
| jperNotFound | |
| jperError | |
Definition at line 135 of file jsonpath_exec.c.
|
static |
Definition at line 3194 of file jsonpath_exec.c.
References executeNextItem(), fb(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, and JsonbValue::type.
Referenced by executeItemOptUnwrapTarget().
Definition at line 3517 of file jsonpath_exec.c.
References cmp(), fb(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 3992 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 3980 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg, ERROR, and fb().
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), and executeDateTimeMethod().
Definition at line 4004 of file jsonpath_exec.c.
References date_cmp_timestamp_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 4013 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), date_cmp_timestamptz_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 4024 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), fb(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 4037 of file jsonpath_exec.c.
References castTimeToTimeTz(), cmpDateToTimestamp(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), date_cmp(), DatumGetDateADT(), DatumGetInt32(), DatumGetTimestamp(), DatumGetTimestampTz(), DirectFunctionCall2, elog, ERROR, fb(), time_cmp(), timestamp_cmp(), and timetz_cmp().
Referenced by compareItems().
|
static |
Definition at line 3605 of file jsonpath_exec.c.
References cmp(), compareDatetime(), compareNumeric(), compareStrings(), elog, ERROR, fb(), jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbFalse, jpbTrue, jpbUnknown, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, and jpiNotEqual.
Referenced by executeComparison().
Definition at line 3701 of file jsonpath_exec.c.
References a, b, DatumGetInt32(), DirectFunctionCall2, numeric_cmp(), and NumericGetDatum().
Referenced by compareItems().
|
static |
Definition at line 3538 of file jsonpath_exec.c.
References binaryCompareStrings(), cmp(), fb(), GetDatabaseEncoding(), pfree(), pg_server_to_any(), PG_SQL_ASCII, and PG_UTF8.
Referenced by compareItems().
|
static |
Definition at line 3709 of file jsonpath_exec.c.
References fb(), and palloc_object.
Referenced by JsonPathValue().
Definition at line 3300 of file jsonpath_exec.c.
References list_length().
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
Definition at line 3467 of file jsonpath_exec.c.
References ereport, errcode(), errdetail(), errmsg, ERROR, fb(), and JsonContainerIsObject.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), and jsonb_path_query_internal().
|
static |
Definition at line 1988 of file jsonpath_exec.c.
References Assert, check_stack_depth(), executeAnyItem(), executeItemOptUnwrapTarget(), fb(), JsonPathExecContext::ignoreStructuralErrors, jbvBinary, jperIsError, jperNotFound, jperOk, JsonbIteratorInit(), JsonbIteratorNext(), JsonValueListAppend(), PG_UINT32_MAX, JsonbValue::type, JsonbValue::val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by executeAnyItem(), executeItemOptUnwrapTarget(), and executeItemUnwrapTargetArray().
|
static |
Definition at line 2173 of file jsonpath_exec.c.
References ereport, errcode(), errmsg, ERROR, ErrorSaveContext::error_occurred, executeItemOptUnwrapResult(), executeNextItem(), fb(), getScalar(), jbvNumeric, jperError, jperIsError, jperOk, JsonValueListClear(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsSingleton(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspOperationName(), jspThrowErrors, RETURN_ERROR, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1824 of file jsonpath_exec.c.
References JsonPathItem::base, check_stack_depth(), elog, ERROR, executeBoolItem(), executeComparison(), executeItemOptUnwrapResultNoThrow(), executeLikeRegex(), executePredicate(), executeStartsWith(), fb(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, jperOk, jpiAnd, jpiEqual, jpiExists, jpiGreater, jpiGreaterOrEqual, jpiIsUnknown, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiNot, jpiNotEqual, jpiOr, jpiStartsWith, JsonValueListClear(), JsonValueListInit(), JsonValueListIsEmpty(), jspGetArg(), jspGetLeftArg(), jspGetRightArg(), jspHasNext, jspInitByBuffer(), and jspStrictAbsenceOfErrors.
Referenced by executeBoolItem(), executeItemOptUnwrapTarget(), and executeNestedBoolItem().
|
static |
Definition at line 3506 of file jsonpath_exec.c.
References cmp(), compareItems(), fb(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 2445 of file jsonpath_exec.c.
References AdjustTimeForTypmod(), AdjustTimestampForTypmod(), anytime_typmod_check(), anytimestamp_typmod_check(), checkTimezoneIsUsedForCast(), collid, cstring_to_text(), cstring_to_text_with_len(), date_timestamp(), date_timestamptz(), DatumGetDateADT(), DatumGetTimeADT(), DatumGetTimestamp(), DatumGetTimestampTz(), DatumGetTimeTzADTP(), DetermineTimeZoneOffset(), DirectFunctionCall1, elog, ereport, errcode(), errhint(), errmsg, ERROR, ErrorSaveContext::error_occurred, executeNextItem(), fb(), getScalar(), i, j2date(), jbvDatetime, jbvString, jperError, jperIsError, jperNotFound, jperOk, jpiDate, jpiDatetime, jpiNumeric, jpiString, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jspGetArg(), jspGetNext(), jspGetNumeric(), jspGetString(), jspOperationName(), jspThrowErrors, lengthof, MemoryContextSwitchTo(), numeric_int4_safe(), parse_datetime(), pfree(), POSTGRES_EPOCH_JDATE, result, RETURN_ERROR, session_timezone, text_to_cstring(), time_timetz(), TimeADTGetDatum(), timestamp2tm(), timestamp_date(), timestamp_time(), timestamp_timestamptz(), TimestampGetDatum(), timestamptz_date(), timestamptz_time(), timestamptz_timestamp(), timestamptz_timetz(), TimestampTzGetDatum(), timetz_time(), TimeTzADTPGetDatum(), tm, pg_tm::tm_hour, pg_tm::tm_mday, pg_tm::tm_min, pg_tm::tm_mon, pg_tm::tm_sec, pg_tm::tm_year, TopMemoryContext, JsonPathItem::type, JsonPathExecContext::useTz, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 777 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), fb(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1763 of file jsonpath_exec.c.
References Assert, executeItem(), executeItemUnwrapTargetArray(), fb(), jbvArray, jperIsError, jperOk, JsonbType(), JsonValueListAppend(), JsonValueListClear(), JsonValueListInit(), JsonValueListInitIterator(), JsonValueListNext(), jspAutoUnwrap, and JsonbValue::type.
Referenced by executeBinaryArithmExpr(), executeItemOptUnwrapResultNoThrow(), and executeUnaryArithmExpr().
|
static |
Definition at line 1807 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), fb(), and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 789 of file jsonpath_exec.c.
References appendBoolResult(), Assert, JsonPathExecContext::baseObject, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), construct_array_builtin(), CStringGetDatum(), JsonPathExecContext::current, DatumGetCString(), DatumGetInt32(), DatumGetNumeric(), DirectFunctionCall1, DirectInputFunctionCallSafe(), elog, ereport, errcode(), errmsg, ERROR, ErrorSaveContext::error_occurred, executeAnyItem(), executeBinaryArithmExpr(), executeBoolItem(), executeDateTimeMethod(), executeItemUnwrapTargetArray(), executeKeyValueMethod(), executeNestedBoolItem(), executeNextItem(), executeNumericItemMethod(), executeStringInternalMethod(), executeUnaryArithmExpr(), fb(), findJsonbValueFromContainer(), float8_numeric(), Float8GetDatum(), float8in_internal(), getArrayIndex(), getIthJsonbValueFromContainer(), getJsonPathItem(), i, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, Int32GetDatum(), int4_numeric(), int4in(), int64_to_numeric(), Int64GetDatum(), int8_numeric(), int8in(), InvalidOid, JB_FOBJECT, jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbTrue, jperError, jperIsError, jperNotFound, jperOk, jpiAbs, jpiAdd, jpiAnd, jpiAny, jpiAnyArray, jpiAnyKey, jpiBigint, jpiBool, jpiBoolean, jpiCeiling, jpiCurrent, jpiDate, jpiDatetime, jpiDecimal, jpiDiv, jpiDouble, jpiEqual, jpiExists, jpiFilter, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiIndexArray, jpiInteger, jpiIsUnknown, jpiKey, jpiKeyValue, jpiLast, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNot, jpiNotEqual, jpiNull, jpiNumber, jpiNumeric, jpiOr, jpiPlus, jpiRoot, jpiSize, jpiStartsWith, jpiStrBtrim, jpiString, jpiStringFunc, jpiStrInitcap, jpiStrLower, jpiStrLtrim, jpiStrReplace, jpiStrRtrim, jpiStrSplitPart, jpiStrUpper, jpiSub, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jpiType, jpiVariable, JsonbArraySize(), JsonbType(), JsonbTypeName(), JsonEncodeDateTime(), jspAutoUnwrap, jspAutoWrap, jspGetArg(), jspGetArraySubscript(), jspGetLeftArg(), jspGetNext(), jspGetNumeric(), jspGetRightArg(), jspGetString(), jspIgnoreStructuralErrors, jspOperationName(), jspThrowErrors, JsonValueList::last, MAXDATELEN, numeric_abs(), numeric_add_safe(), numeric_ceil(), numeric_div_safe(), numeric_floor(), numeric_in(), numeric_int4_safe(), numeric_int8_safe(), numeric_is_inf(), numeric_is_nan(), numeric_mod_safe(), numeric_mul_safe(), numeric_out(), numeric_sub_safe(), numeric_uminus(), NumericGetDatum(), numerictypmodin(), parse_bool(), pfree(), pg_ltoa(), pnstrdup(), PointerGetDatum(), pstrdup(), range(), RETURN_ERROR, JsonPathExecContext::root, scale, setBaseObject(), JsonbValue::type, JsonPathItem::type, and val.
Referenced by executeAnyItem(), and executeItem().
|
static |
Definition at line 1712 of file jsonpath_exec.c.
References Assert, elog, ERROR, executeAnyItem(), fb(), jbvArray, and jbvBinary.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 715 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, JsonPathExecContext::current, executeItem(), fb(), JsonPathExecContext::getVar, JsonPath::header, JsonBaseObjectInfo::id, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, JsonBaseObjectInfo::jbc, jperIsError, jperNotFound, jperOk, JsonbExtractScalar(), JsonbInitBinary(), JSONPATH_LAX, JsonValueListClear(), JsonValueListInit(), JsonValueListIsEmpty(), jspInit(), jspStrictAbsenceOfErrors, JsonPathExecContext::lastGeneratedObjectId, JsonPathExecContext::laxMode, result, JsonPathExecContext::root, Jsonb::root, JsonPathExecContext::throwErrors, JsonPathExecContext::useTz, and JsonPathExecContext::vars.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), jsonb_path_query_internal(), JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3084 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, ereport, errcode(), errmsg, ERROR, executeNextItem(), fb(), JsonBaseObjectInfo::id, int64_to_numeric(), INT64CONST, JsonBaseObjectInfo::jbc, jbvBinary, jbvNumeric, jbvObject, jbvString, jperIsError, jperNotFound, jperOk, JsonbInitBinary(), JsonbIteratorInit(), JsonbIteratorNext(), JsonbType(), JsonbValueToJsonb(), JsonContainerSize, jspGetNext(), jspOperationName(), JsonPathExecContext::lastGeneratedObjectId, next, ps, pushJsonbValue(), RETURN_ERROR, setBaseObject(), val, WJB_BEGIN_OBJECT, WJB_DONE, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2373 of file jsonpath_exec.c.
References JsonLikeRegexContext::cflags, cstring_to_text_with_len(), fb(), getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, jspConvertRegexFlags(), RE_compile_and_execute(), JsonLikeRegexContext::regex, and str.
Referenced by executeBoolItem().
|
static |
Definition at line 1967 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and fb().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1732 of file jsonpath_exec.c.
References cur, executeItem(), fb(), jperOk, JsonValueListAppend(), jspGetNext(), jspHasNext, and next.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), executeStringInternalMethod(), and executeUnaryArithmExpr().
|
static |
Definition at line 2404 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg, ERROR, executeItemUnwrapTargetArray(), executeNextItem(), fb(), getScalar(), jbvArray, jbvNumeric, jperOk, JsonbType(), jspGetNext(), jspOperationName(), next, NumericGetDatum(), and RETURN_ERROR.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2079 of file jsonpath_exec.c.
References error(), executeItemOptUnwrapResultNoThrow(), fb(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, JsonValueListClear(), JsonValueListInit(), JsonValueListInitIterator(), JsonValueListNext(), and jspStrictAbsenceOfErrors.
Referenced by executeBoolItem().
|
static |
Definition at line 2349 of file jsonpath_exec.c.
References fb(), getScalar(), jbvString, jpbFalse, jpbTrue, and jpbUnknown.
Referenced by executeBoolItem().
|
static |
Definition at line 2905 of file jsonpath_exec.c.
References Assert, btrim(), btrim1(), cstring_to_text_with_len(), CStringGetTextDatum, DirectFunctionCall1, DirectFunctionCall1Coll(), DirectFunctionCall2Coll(), DirectFunctionCall3Coll(), elog, ereport, errcode(), errmsg, ERROR, executeNextItem(), fb(), getScalar(), initcap(), jbvString, jperNotFound, jperOk, jpiNumeric, jpiStrBtrim, jpiString, jpiStrInitcap, jpiStrLower, jpiStrLtrim, jpiStrReplace, jpiStrRtrim, jpiStrSplitPart, jpiStrUpper, jspGetArg(), jspGetLeftArg(), jspGetNext(), jspGetNumeric(), jspGetRightArg(), jspGetString(), jspOperationName(), lower(), ltrim(), ltrim1(), numeric_int4(), NumericGetDatum(), PointerGetDatum(), replace_text(), RETURN_ERROR, rtrim(), rtrim1(), split_part(), str, TextDatumGetCString, JsonPathItem::type, and upper().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2270 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg, ERROR, executeItemOptUnwrapResult(), executeNextItem(), fb(), getScalar(), jbvNumeric, jperIsError, jperNotFound, jperOk, JsonValueListClear(), JsonValueListInit(), JsonValueListInitIterator(), JsonValueListNext(), jspGetArg(), jspGetNext(), jspOperationName(), NumericGetDatum(), RETURN_ERROR, and val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3723 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall2, ereport, errcode(), errmsg, ERROR, ErrorSaveContext::error_occurred, executeItem(), fb(), getScalar(), Int32GetDatum(), jbvNumeric, jperIsError, jperOk, JsonValueListClear(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsSingleton(), numeric_int4_safe(), numeric_trunc(), NumericGetDatum(), and RETURN_ERROR.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3222 of file jsonpath_exec.c.
References elog, ERROR, getJsonPathVariable(), jbvBool, jbvNull, jbvNumeric, jbvString, jpiBool, jpiNull, jpiNumeric, jpiString, jpiVariable, jspGetBool(), jspGetNumeric(), jspGetString(), JsonPathItem::type, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3255 of file jsonpath_exec.c.
References fb(), JsonPathVariable::isnull, jbvNull, JsonItemFromDatum(), lfirst, JsonPathVariable::name, JsonPathVariable::namelen, palloc_object, result, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3405 of file jsonpath_exec.c.
References Assert, ereport, errcode(), errmsg, ERROR, fb(), JsonPathExecContext::getVar, jpiVariable, jspGetString(), pnstrdup(), setBaseObject(), variable::type, value, and JsonPathExecContext::vars.
Referenced by getJsonPathItem().
|
static |
Definition at line 3437 of file jsonpath_exec.c.
References fb(), findJsonbValueFromContainer(), JB_FOBJECT, jbvString, JsonbInitBinary(), result, JsonbValue::type, and JsonbValue::val.
Referenced by jsonb_path_exists_internal(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), and jsonb_path_query_internal().
|
inlinestatic |
Definition at line 4399 of file jsonpath_exec.c.
References elog, ERROR, IsA, JSON_TABLE_EXEC_CONTEXT_MAGIC, and result.
Referenced by JsonTableDestroyOpaque(), JsonTableFetchRow(), JsonTableGetValue(), and JsonTableSetDocument().
|
static |
Definition at line 3950 of file jsonpath_exec.c.
References Assert, fb(), jbvBinary, JsonContainerIsScalar, type, JsonbValue::type, and JsonbValue::val.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeLikeRegex(), executeNumericItemMethod(), executeStartsWith(), executeStringInternalMethod(), executeUnaryArithmExpr(), and getArrayIndex().
| Datum jsonb_path_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 455 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 427 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), jperIsError, jperOk, PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, and PG_RETURN_NULL.
Referenced by jsonb_path_exists(), jsonb_path_exists_opr(), and jsonb_path_exists_tz().
| Datum jsonb_path_exists_opr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 472 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 461 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 527 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 484 of file jsonpath_exec.c.
References countVariablesFromJsonb(), ereport, errcode(), errmsg, ERROR, executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), jbvBool, jbvNull, JsonValueListHead(), JsonValueListInit(), JsonValueListIsSingleton(), PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, and PG_RETURN_NULL.
Referenced by jsonb_path_match(), jsonb_path_match_opr(), and jsonb_path_match_tz().
| Datum jsonb_path_match_opr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 544 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 533 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 606 of file jsonpath_exec.c.
References jsonb_path_query_internal().
| Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 641 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 623 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), JsonValueListInit(), PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_RETURN_JSONB_P, and wrapItemsInArray().
Referenced by jsonb_path_query_array(), and jsonb_path_query_array_tz().
| Datum jsonb_path_query_array_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 647 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
| Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 679 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 658 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsEmpty(), PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_RETURN_JSONB_P, and PG_RETURN_NULL.
Referenced by jsonb_path_query_first(), and jsonb_path_query_first_tz().
| Datum jsonb_path_query_first_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 685 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 556 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), fb(), getJsonPathVariableFromJsonb(), JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListInit(), JsonValueListInitIterator(), JsonValueListNext(), MemoryContextSwitchTo(), palloc_object, PG_GETARG_BOOL, PG_GETARG_JSONB_P_COPY, PG_GETARG_JSONPATH_P_COPY, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, and SRF_RETURN_NEXT.
Referenced by jsonb_path_query(), and jsonb_path_query_tz().
| Datum jsonb_path_query_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 612 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 3489 of file jsonpath_exec.c.
References Assert, fb(), jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, and JsonContainerSize.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3913 of file jsonpath_exec.c.
References fb(), jbvBinary, JsonbValue::type, and VARSIZE_ANY_EXHDR().
Referenced by executeJsonPath(), executeKeyValueMethod(), getJsonPathVariableFromJsonb(), and JsonItemFromDatum().
|
static |
Definition at line 3926 of file jsonpath_exec.c.
References Assert, elog, ERROR, fb(), JsonbContainer::header, jbvArray, jbvBinary, jbvObject, JsonContainerIsArray, JsonContainerIsObject, JsonContainerIsScalar, and type.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), and executeNumericItemMethod().
|
static |
Definition at line 3395 of file jsonpath_exec.c.
References DatumGetNumeric(), fb(), and jbvNumeric.
Referenced by JsonItemFromDatum().
Definition at line 3313 of file jsonpath_exec.c.
References Assert, CStringGetDatum(), DatumGetBool(), DatumGetJsonbP(), DatumGetPointer(), DatumGetTextP, DirectFunctionCall1, ereport, errcode(), errmsg, ERROR, fb(), float4_numeric(), float8_numeric(), format_type_be(), int2_numeric(), int4_numeric(), int8_numeric(), jbvBool, jbvDatetime, jbvString, jsonb_in(), JsonbExtractScalar(), JsonbInitBinary(), JsonbPGetDatum(), JsonbValueInitNumericDatum(), JsonContainerIsScalar, JsonItemFromDatum(), pfree(), PG_USED_FOR_ASSERTS_ONLY, result, str, text_to_cstring(), JsonbValue::type, JsonbValue::val, val, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by GetJsonPathVar(), and JsonItemFromDatum().
Definition at line 4202 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, and jperOk.
Referenced by ExecEvalJsonExprPath().
| Datum JsonPathQuery | ( | Datum | jb, |
| JsonPath * | jp, | ||
| JsonWrapper | wrapper, | ||
| bool * | empty, | ||
| bool * | error, | ||
| List * | vars, | ||
| const char * | column_name | ||
| ) |
Definition at line 4225 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), elog, ereport, errcode(), errhint(), errmsg, ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListHasMultipleItems(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsEmpty(), JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, JSW_UNSPEC, PointerGetDatum(), and wrapItemsInArray().
Referenced by ExecEvalJsonExprPath().
| JsonbValue * JsonPathValue | ( | Datum | jb, |
| JsonPath * | jp, | ||
| bool * | empty, | ||
| bool * | error, | ||
| List * | vars, | ||
| const char * | column_name | ||
| ) |
Definition at line 4315 of file jsonpath_exec.c.
References Assert, copyJsonbValue(), CountJsonPathVars(), DatumGetJsonbP(), ereport, errcode(), errmsg, ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), IsAJsonbScalar, jbvBinary, jbvNull, jperIsError, JsonbExtractScalar(), JsonContainerIsScalar, JsonValueListHasMultipleItems(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsEmpty(), PG_USED_FOR_ASSERTS_ONLY, JsonbValue::type, and JsonbValue::val.
Referenced by ExecEvalJsonExprPath().
|
static |
Definition at line 4484 of file jsonpath_exec.c.
References fb(), GetJsonTableExecContext(), and JsonTableExecContext::magic.
|
static |
Definition at line 4747 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTablePlanNextRow(), and JsonTableExecContext::rootplanstate.
|
static |
Definition at line 4763 of file jsonpath_exec.c.
References ExprContext::caseValue_datum, ExprContext::caseValue_isNull, JsonTableExecContext::colplanstates, JsonTablePlanState::current, ExecEvalExpr(), fb(), GetJsonTableExecContext(), Int32GetDatum(), JsonTablePlanRowSource::isnull, list_nth(), JsonTablePlanState::ordinal, result, and JsonTablePlanRowSource::value.
|
static |
Definition at line 4420 of file jsonpath_exec.c.
References Assert, castNode, JsonTableExecContext::colplanstates, CurrentMemoryContext, TableFunc::docexpr, ExecEvalExpr(), exprType(), exprTypmod(), fb(), forboth, JsonPathVariable::isnull, JSON_TABLE_EXEC_CONTEXT_MAGIC, JsonTableInitPlan(), lappend(), lfirst_node, list_length(), JsonTableExecContext::magic, name, JsonPathVariable::name, JsonPathVariable::namelen, NIL, palloc0_object, palloc_array, palloc_object, ps, pstrdup(), JsonTableExecContext::rootplanstate, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
|
static |
Definition at line 4501 of file jsonpath_exec.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, JsonTablePlanState::args, JsonTablePathScan::child, JsonTablePathScan::colMax, JsonTablePathScan::colMin, JsonTableExecContext::colplanstates, JsonTablePlanState::current, DatumGetJsonPathP(), fb(), JsonTablePlanState::found, i, IsA, JsonTablePlanRowSource::isnull, JsonTableInitPlan(), JsonValueListInit(), JsonTablePlanState::left, JsonTableSiblingJoin::lplan, JsonTablePlanState::mcxt, JsonTablePlanState::nested, palloc0_object, JsonTablePlanState::parent, JsonTablePlanState::path, JsonTablePathScan::path, JsonTablePlanState::plan, plan, PointerGetDatum(), JsonTablePlanState::right, JsonTableSiblingJoin::rplan, JsonTablePlanRowSource::value, and JsonTablePath::value.
Referenced by JsonTableInitOpaque(), and JsonTableInitPlan().
|
static |
Definition at line 4720 of file jsonpath_exec.c.
References JsonTablePlanNextRow(), JsonTablePlanState::left, and JsonTablePlanState::right.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4602 of file jsonpath_exec.c.
References Assert, elog, ERROR, IsA, JsonTablePlanJoinNextRow(), JsonTablePlanScanNextRow(), and JsonTablePlanState::plan.
Referenced by JsonTableFetchRow(), JsonTablePlanJoinNextRow(), and JsonTablePlanScanNextRow().
|
static |
Definition at line 4629 of file jsonpath_exec.c.
References JsonTablePlanState::current, fb(), JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, JsonbPGetDatum(), JsonbValueToJsonb(), JsonTablePlanNextRow(), JsonTableResetNestedPlan(), JsonValueListNext(), JsonTablePlanState::mcxt, MemoryContextSwitchTo(), JsonTablePlanState::nested, JsonTablePlanState::ordinal, PointerGetDatum(), and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4691 of file jsonpath_exec.c.
References Assert, JsonTablePlanState::current, fb(), IsA, JsonTablePlanRowSource::isnull, JsonTableResetNestedPlan(), JsonTableResetRowPattern(), JsonTablePlanState::left, JsonTablePlanState::parent, JsonTablePlanState::plan, JsonTablePlanState::right, and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanScanNextRow(), and JsonTableResetNestedPlan().
|
static |
Definition at line 4562 of file jsonpath_exec.c.
References JsonTablePlanState::args, Assert, castNode, CountJsonPathVars(), JsonTablePlanState::current, DatumGetJsonbP(), JsonTablePathScan::errorOnError, executeJsonPath(), fb(), JsonTablePlanState::found, GetJsonPathVar(), JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, jperIsError, JsonValueListClear(), JsonValueListInitIterator(), JsonTablePlanState::mcxt, MemoryContextResetOnly(), MemoryContextSwitchTo(), JsonTablePlanState::ordinal, JsonTablePlanState::path, JsonTablePlanState::plan, PointerGetDatum(), and JsonTablePlanRowSource::value.
Referenced by JsonTableResetNestedPlan(), and JsonTableSetDocument().
|
static |
Definition at line 4549 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTableResetRowPattern(), JsonTableExecContext::rootplanstate, and value.
|
static |
Definition at line 3813 of file jsonpath_exec.c.
References fb(), JsonValueList::items, items, JsonValueList::last, Max, JsonValueList::maxitems, MIN_EXTRA_JVL_ITEMS, JsonValueList::next, JsonValueList::nitems, and palloc().
Referenced by executeAnyItem(), executeItemOptUnwrapResult(), and executeNextItem().
|
static |
Definition at line 3795 of file jsonpath_exec.c.
References Assert, BASE_JVL_ITEMS, fb(), JsonValueList::next, and pfree().
Referenced by executeBinaryArithmExpr(), executeBoolItem(), executeItemOptUnwrapResult(), executeJsonPath(), executePredicate(), executeUnaryArithmExpr(), getArrayIndex(), and JsonTableResetRowPattern().
|
static |
Definition at line 3861 of file jsonpath_exec.c.
References fb().
Referenced by JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3872 of file jsonpath_exec.c.
Referenced by executeBinaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3786 of file jsonpath_exec.c.
References BASE_JVL_ITEMS, and fb().
Referenced by executeBinaryArithmExpr(), executeBoolItem(), executeItemOptUnwrapResult(), executeJsonPath(), executePredicate(), executeUnaryArithmExpr(), getArrayIndex(), jsonb_path_match_internal(), jsonb_path_query_array_internal(), jsonb_path_query_first_internal(), jsonb_path_query_internal(), JsonPathQuery(), JsonPathValue(), and JsonTableInitPlan().
|
static |
Definition at line 3883 of file jsonpath_exec.c.
References fb().
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTableResetRowPattern(), and wrapItemsInArray().
|
static |
Definition at line 3843 of file jsonpath_exec.c.
References fb().
Referenced by executeBoolItem(), executeJsonPath(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3850 of file jsonpath_exec.c.
References fb().
Referenced by executeBinaryArithmExpr(), getArrayIndex(), and jsonb_path_match_internal().
|
static |
Definition at line 3894 of file jsonpath_exec.c.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTablePlanScanNextRow(), and wrapItemsInArray().
|
static |
Definition at line 3770 of file jsonpath_exec.c.
References JsonPathExecContext::baseObject, fb(), JsonBaseObjectInfo::id, JsonBaseObjectInfo::jbc, and jbvBinary.
Referenced by executeItemOptUnwrapTarget(), executeKeyValueMethod(), and getJsonPathVariable().
|
static |
Definition at line 3961 of file jsonpath_exec.c.
References fb(), items, JsonValueListInitIterator(), JsonValueListNext(), ps, pushJsonbValue(), WJB_BEGIN_ARRAY, WJB_ELEM, and WJB_END_ARRAY.
Referenced by jsonb_path_query_array_internal(), and JsonPathQuery().
| const TableFuncRoutine JsonbTableRoutine |
Definition at line 400 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().