|
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 3016 of file jsonpath_exec.c.
References executeNextItem(), fb(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, and JsonbValue::type.
Referenced by executeItemOptUnwrapTarget().
Definition at line 3339 of file jsonpath_exec.c.
References cmp(), fb(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 3814 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 3802 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg, ERROR, and fb().
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), and executeDateTimeMethod().
Definition at line 3826 of file jsonpath_exec.c.
References date_cmp_timestamp_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 3835 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), date_cmp_timestamptz_internal(), and fb().
Referenced by compareDatetime().
|
static |
Definition at line 3846 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), fb(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 3859 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 3427 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 3523 of file jsonpath_exec.c.
References a, b, DatumGetInt32(), DirectFunctionCall2, numeric_cmp(), and NumericGetDatum().
Referenced by compareItems().
|
static |
Definition at line 3360 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 3531 of file jsonpath_exec.c.
References fb(), and palloc_object.
Referenced by JsonPathValue().
Definition at line 3122 of file jsonpath_exec.c.
References list_length().
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
Definition at line 3289 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 1970 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 2155 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 1806 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 3328 of file jsonpath_exec.c.
References cmp(), compareItems(), fb(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 2427 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, RETURN_ERROR, session_timezone, text_to_cstring(), TimeTzADT::time, 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 775 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), fb(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1745 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 1789 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), fb(), and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 787 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(), 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, jpiString, jpiStringFunc, 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 1694 of file jsonpath_exec.c.
References Assert, elog, ERROR, executeAnyItem(), fb(), jbvArray, and jbvBinary.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 713 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, 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 2906 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 2355 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 1949 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and fb().
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1714 of file jsonpath_exec.c.
References cur, executeItem(), fb(), jperOk, JsonValueListAppend(), jspGetNext(), jspHasNext, and next.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), and executeUnaryArithmExpr().
|
static |
Definition at line 2386 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 2061 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 2331 of file jsonpath_exec.c.
References fb(), getScalar(), jbvString, jpbFalse, jpbTrue, and jpbUnknown.
Referenced by executeBoolItem().
|
static |
Definition at line 2252 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 3545 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 3044 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 3077 of file jsonpath_exec.c.
References fb(), JsonPathVariable::isnull, jbvNull, JsonItemFromDatum(), lfirst, JsonPathVariable::name, JsonPathVariable::namelen, palloc_object, JsonbValue::type, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3227 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 3259 of file jsonpath_exec.c.
References fb(), findJsonbValueFromContainer(), JB_FOBJECT, jbvString, JsonbInitBinary(), 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 4221 of file jsonpath_exec.c.
References elog, ERROR, IsA, JSON_TABLE_EXEC_CONTEXT_MAGIC, and JsonTableExecContext::magic.
Referenced by JsonTableDestroyOpaque(), JsonTableFetchRow(), JsonTableGetValue(), and JsonTableSetDocument().
|
static |
Definition at line 3772 of file jsonpath_exec.c.
References Assert, fb(), jbvBinary, JsonContainerIsScalar, type, JsonbValue::type, and JsonbValue::val.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeLikeRegex(), executeNumericItemMethod(), executeStartsWith(), executeUnaryArithmExpr(), and getArrayIndex().
| Datum jsonb_path_exists | ( | PG_FUNCTION_ARGS | ) |
Definition at line 453 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 425 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 470 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 459 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
| Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 525 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 482 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 542 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 531 of file jsonpath_exec.c.
References jsonb_path_match_internal().
| Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 604 of file jsonpath_exec.c.
References jsonb_path_query_internal().
| Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 639 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 621 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 645 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
| Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 677 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 656 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 683 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 554 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 610 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 3311 of file jsonpath_exec.c.
References Assert, fb(), jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, and JsonContainerSize.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3735 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 3748 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 3217 of file jsonpath_exec.c.
References DatumGetNumeric(), fb(), and jbvNumeric.
Referenced by JsonItemFromDatum().
Definition at line 3135 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, str, text_to_cstring(), JsonbValue::type, JsonbValue::val, val, VARDATA_ANY(), and VARSIZE_ANY_EXHDR().
Referenced by GetJsonPathVar(), and JsonItemFromDatum().
Definition at line 4024 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 4047 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 4137 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 4306 of file jsonpath_exec.c.
References fb(), GetJsonTableExecContext(), and JsonTableExecContext::magic.
|
static |
Definition at line 4569 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTablePlanNextRow(), and JsonTableExecContext::rootplanstate.
|
static |
Definition at line 4585 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, and JsonTablePlanRowSource::value.
|
static |
Definition at line 4242 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 4323 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 4542 of file jsonpath_exec.c.
References JsonTablePlanNextRow(), JsonTablePlanState::left, and JsonTablePlanState::right.
Referenced by JsonTablePlanNextRow().
|
static |
Definition at line 4424 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 4451 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 4513 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 4384 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 4371 of file jsonpath_exec.c.
References GetJsonTableExecContext(), JsonTableResetRowPattern(), JsonTableExecContext::rootplanstate, and value.
|
static |
Definition at line 3635 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 3617 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 3683 of file jsonpath_exec.c.
References fb().
Referenced by JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3694 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 3608 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 3705 of file jsonpath_exec.c.
References fb().
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTableResetRowPattern(), and wrapItemsInArray().
|
static |
Definition at line 3665 of file jsonpath_exec.c.
References fb().
Referenced by executeBoolItem(), executeJsonPath(), jsonb_path_query_first_internal(), JsonPathQuery(), and JsonPathValue().
|
static |
Definition at line 3672 of file jsonpath_exec.c.
References fb().
Referenced by executeBinaryArithmExpr(), getArrayIndex(), and jsonb_path_match_internal().
|
static |
Definition at line 3716 of file jsonpath_exec.c.
Referenced by executeItemOptUnwrapResult(), executePredicate(), executeUnaryArithmExpr(), jsonb_path_query_internal(), JsonTablePlanScanNextRow(), and wrapItemsInArray().
|
static |
Definition at line 3592 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 3783 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 398 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().