|
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 254 of file jsonpath_exec.c.
| #define jspAutoUnwrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 272 of file jsonpath_exec.c.
| #define jspAutoWrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 273 of file jsonpath_exec.c.
| #define jspIgnoreStructuralErrors | ( | cxt | ) | ((cxt)->ignoreStructuralErrors) |
Definition at line 274 of file jsonpath_exec.c.
| #define jspStrictAbsenceOfErrors | ( | cxt | ) | (!(cxt)->laxMode) |
Definition at line 271 of file jsonpath_exec.c.
| #define jspThrowErrors | ( | cxt | ) | ((cxt)->throwErrors) |
Definition at line 275 of file jsonpath_exec.c.
Definition at line 169 of file jsonpath_exec.c.
| #define RETURN_ERROR | ( | throw_error | ) |
Definition at line 278 of file jsonpath_exec.c.
Definition at line 290 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 286 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 3202 of file jsonpath_exec.c.
References executeNextItem(), fb(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, and JsonbValue::type.
Referenced by executeItemOptUnwrapTarget().
Definition at line 3525 of file jsonpath_exec.c.
References cmp(), fb(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 4000 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 3988 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg, ERROR, and fb().
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), and executeDateTimeMethod().
Definition at line 4012 of file jsonpath_exec.c.
References date_cmp_timestamp_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 4021 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), date_cmp_timestamptz_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 4032 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), fb(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 4045 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 3613 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 3709 of file jsonpath_exec.c.
References a, b, DatumGetInt32(), DirectFunctionCall2, numeric_cmp(), and NumericGetDatum().
Referenced by compareItems().
|
static |
Definition at line 3546 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 3717 of file jsonpath_exec.c.
References fb(), and palloc_object.
Referenced by JsonPathValue().
Definition at line 3308 of file jsonpath_exec.c.
References list_length().
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
Definition at line 3475 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 1984 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 2169 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 1820 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 3514 of file jsonpath_exec.c.
References cmp(), compareItems(), fb(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 2441 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 785 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), fb(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1759 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 1803 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), fb(), and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 797 of file jsonpath_exec.c.
References appendBoolResult(), Assert, JsonPathExecContext::baseObject, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), 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, make_numeric_typmod_safe(), 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(), parse_bool(), pfree(), pnstrdup(), pstrdup(), range(), RETURN_ERROR, JsonPathExecContext::root, scale, setBaseObject(), JsonbValue::type, JsonPathItem::type, and val.
Referenced by executeAnyItem(), and executeItem().
|
static |
Definition at line 1708 of file jsonpath_exec.c.
References Assert, elog, ERROR, executeAnyItem(), fb(), jbvArray, and jbvBinary.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 723 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 3092 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 2369 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 1963 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and fb().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1728 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 2400 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 2075 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 2345 of file jsonpath_exec.c.
References fb(), getScalar(), jbvString, jpbFalse, jpbTrue, and jpbUnknown.
Referenced by executeBoolItem().
|
static |
Definition at line 2900 of file jsonpath_exec.c.
References Assert, btrim(), btrim1(), cstring_to_text_with_len(), CStringGetTextDatum, DirectFunctionCall1Coll(), DirectFunctionCall2Coll(), DirectFunctionCall3Coll(), elog, ereport, errcode(), errmsg, ERROR, ErrorSaveContext::error_occurred, executeNextItem(), fb(), getScalar(), initcap(), Int32GetDatum(), 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_safe(), PointerGetDatum, replace_text(), RETURN_ERROR, rtrim(), rtrim1(), split_part(), str, TextDatumGetCString, JsonPathItem::type, and upper().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2266 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 3731 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 3230 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 3263 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 3413 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 3445 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 4407 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 3958 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 463 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 435 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 480 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 469 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 535 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 492 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 552 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 541 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 614 of file jsonpath_exec.c.
References jsonb_path_query_internal().
| Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 649 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 631 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 655 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
| Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 687 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 666 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 693 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 564 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 620 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 3497 of file jsonpath_exec.c.
References Assert, fb(), jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, and JsonContainerSize.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3921 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 3934 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 3403 of file jsonpath_exec.c.
References DatumGetNumeric(), fb(), and jbvNumeric.
Referenced by JsonItemFromDatum().
Definition at line 3321 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 4210 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 4233 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 4323 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 4492 of file jsonpath_exec.c.
References fb(), GetJsonTableExecContext(), and JsonTableExecContext::magic.
|
static |
Definition at line 4785 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTablePlanNextRow(), and JsonTableExecContext::rootplanstate.
|
static |
Definition at line 4801 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 4428 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 4509 of file jsonpath_exec.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, JsonTablePlanState::args, JsonTablePathScan::child, JsonTablePathScan::colMax, JsonTablePathScan::colMin, JsonTableExecContext::colplanstates, JsonTablePlanState::cross, JsonTableSiblingJoin::cross, JsonTablePlanState::current, DatumGetJsonPathP(), fb(), JsonTablePlanState::found, i, IsA, JsonTablePlanRowSource::isnull, JsonTableInitPlan(), JsonValueListInit(), JsonTablePlanState::left, JsonTableSiblingJoin::lplan, JsonTablePlanState::mcxt, JsonTablePlanState::nested, JsonTablePlanState::outerJoin, JsonTablePathScan::outerJoin, 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 4609 of file jsonpath_exec.c.
References JsonTablePlanState::advanceNested, JsonTablePlanState::advanceRight, Assert, JsonTablePlanState::cross, JsonTablePlanState::current, fb(), IsA, JsonTablePlanRowSource::isnull, JsonTablePlanNextRow(), JsonTablePlanScanNextRow(), JsonTableRescan(), JsonTableResetNestedPlan(), JsonTableResetRowPattern(), JsonTablePlanState::left, JsonTablePlanState::nested, JsonTablePlanState::outerJoin, JsonTablePlanState::parent, JsonTablePlanState::plan, JsonTablePlanState::reset, JsonTablePlanState::right, and JsonTablePlanRowSource::value.
Referenced by JsonTableFetchRow(), and JsonTablePlanNextRow().
|
static |
Definition at line 4709 of file jsonpath_exec.c.
References JsonTablePlanState::current, fb(), JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListNext(), JsonTablePlanState::mcxt, MemoryContextSwitchTo(), JsonTablePlanState::ordinal, PointerGetDatum, and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4845 of file jsonpath_exec.c.
References JsonTablePlanState::advanceRight, JsonTablePlanState::current, fb(), JsonTablePlanState::found, IsA, JsonTablePlanRowSource::isnull, JsonTablePlanState::iter, JsonTableRescan(), JsonValueListInitIterator(), JsonTablePlanState::left, JsonTablePlanState::nested, JsonTablePlanState::ordinal, JsonTablePlanState::plan, PointerGetDatum, JsonTablePlanState::right, and JsonTablePlanRowSource::value.
Referenced by JsonTablePlanNextRow(), JsonTableRescan(), JsonTableResetNestedPlan(), and JsonTableResetRowPattern().
|
static |
Definition at line 4746 of file jsonpath_exec.c.
References JsonTablePlanState::advanceNested, JsonTablePlanState::advanceRight, Assert, JsonTablePlanState::current, fb(), IsA, JsonTablePlanRowSource::isnull, JsonTableRescan(), JsonTableResetNestedPlan(), JsonTablePlanState::left, JsonTablePlanState::nested, JsonTablePlanState::parent, JsonTablePlanState::plan, JsonTablePlanState::reset, and JsonTablePlanState::right.
Referenced by JsonTablePlanNextRow(), and JsonTableResetNestedPlan().
|
static |
Definition at line 4573 of file jsonpath_exec.c.
References JsonTablePlanState::args, Assert, castNode, CountJsonPathVars(), DatumGetJsonbP(), JsonTablePathScan::errorOnError, executeJsonPath(), fb(), JsonTablePlanState::found, GetJsonPathVar(), jperIsError, JsonTableRescan(), JsonValueListClear(), JsonTablePlanState::mcxt, MemoryContextResetOnly(), MemoryContextSwitchTo(), JsonTablePlanState::path, and JsonTablePlanState::plan.
Referenced by JsonTablePlanNextRow(), and JsonTableSetDocument().
|
static |
Definition at line 4560 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTableResetRowPattern(), JsonTableExecContext::rootplanstate, and value.
|
static |
Definition at line 3821 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 3803 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 3869 of file jsonpath_exec.c.
References fb().
Referenced by JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3880 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 3794 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 3891 of file jsonpath_exec.c.
References fb().
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTableRescan(), and wrapItemsInArray().
|
static |
Definition at line 3851 of file jsonpath_exec.c.
References fb().
Referenced by executeBoolItem(), executeJsonPath(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3858 of file jsonpath_exec.c.
References fb().
Referenced by executeBinaryArithmExpr(), getArrayIndex(), and jsonb_path_match_internal().
|
static |
Definition at line 3902 of file jsonpath_exec.c.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTablePlanScanNextRow(), and wrapItemsInArray().
|
static |
Definition at line 3778 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 3969 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 408 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().