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 | 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, bool *error) |
Enumerations | |
enum | JsonPathBool { jpbFalse = 0 , jpbTrue = 1 , jpbUnknown = 2 } |
enum | JsonPathExecResult { jperOk = 0 , jperNotFound = 1 , jperError = 2 } |
Variables | |
const TableFuncRoutine | JsonbTableRoutine |
#define jperIsError | ( | jper | ) | ((jper) == jperError) |
Definition at line 142 of file jsonpath_exec.c.
#define JSON_TABLE_EXEC_CONTEXT_MAGIC 418352867 |
Definition at line 219 of file jsonpath_exec.c.
#define jspAutoUnwrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 237 of file jsonpath_exec.c.
#define jspAutoWrap | ( | cxt | ) | ((cxt)->laxMode) |
Definition at line 238 of file jsonpath_exec.c.
#define jspIgnoreStructuralErrors | ( | cxt | ) | ((cxt)->ignoreStructuralErrors) |
Definition at line 239 of file jsonpath_exec.c.
#define jspStrictAbsenceOfErrors | ( | cxt | ) | (!(cxt)->laxMode) |
Definition at line 236 of file jsonpath_exec.c.
#define jspThrowErrors | ( | cxt | ) | ((cxt)->throwErrors) |
Definition at line 240 of file jsonpath_exec.c.
#define RETURN_ERROR | ( | throw_error | ) |
Definition at line 243 of file jsonpath_exec.c.
Definition at line 255 of file jsonpath_exec.c.
typedef struct JsonBaseObjectInfo JsonBaseObjectInfo |
typedef struct JsonLikeRegexContext JsonLikeRegexContext |
typedef enum JsonPathBool JsonPathBool |
typedef int(* JsonPathCountVarsCallback) (void *vars) |
Definition at line 91 of file jsonpath_exec.c.
typedef struct JsonPathExecContext JsonPathExecContext |
typedef enum JsonPathExecResult JsonPathExecResult |
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 251 of file jsonpath_exec.c.
typedef struct JsonTableExecContext JsonTableExecContext |
typedef struct JsonTablePlanRowSource JsonTablePlanRowSource |
typedef struct JsonTablePlanState JsonTablePlanState |
typedef struct JsonValueList JsonValueList |
typedef struct JsonValueListIterator JsonValueListIterator |
enum JsonPathBool |
enum JsonPathExecResult |
|
static |
Definition at line 2928 of file jsonpath_exec.c.
References executeNextItem(), jbvBool, jbvNull, jpbTrue, jpbUnknown, jperOk, jspGetNext(), next, res, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3251 of file jsonpath_exec.c.
References cmp(), Min, s1, and s2.
Referenced by compareStrings().
Definition at line 3676 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), DirectFunctionCall1, and time_timetz().
Referenced by compareDatetime().
|
static |
Definition at line 3664 of file jsonpath_exec.c.
References ereport, errcode(), errhint(), errmsg(), and ERROR.
Referenced by castTimeToTimeTz(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), and executeDateTimeMethod().
Definition at line 3688 of file jsonpath_exec.c.
References date_cmp_timestamp_internal().
Referenced by compareDatetime().
|
static |
Definition at line 3697 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), and date_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 3708 of file jsonpath_exec.c.
References checkTimezoneIsUsedForCast(), and timestamp_cmp_timestamptz_internal().
Referenced by compareDatetime().
|
static |
Definition at line 3721 of file jsonpath_exec.c.
References castTimeToTimeTz(), cmpDateToTimestamp(), cmpDateToTimestampTz(), cmpTimestampToTimestampTz(), date_cmp(), DatumGetDateADT(), DatumGetInt32(), DatumGetTimestamp(), DatumGetTimestampTz(), DirectFunctionCall2, elog, ERROR, time_cmp(), timestamp_cmp(), and timetz_cmp().
Referenced by compareItems().
|
static |
Definition at line 3339 of file jsonpath_exec.c.
References cmp(), compareDatetime(), compareNumeric(), compareStrings(), elog, ERROR, jbvArray, jbvBinary, jbvBool, jbvDatetime, jbvNull, jbvNumeric, jbvObject, jbvString, jpbFalse, jpbTrue, jpbUnknown, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiNotEqual, res, JsonbValue::type, and JsonbValue::val.
Referenced by executeComparison().
Definition at line 3435 of file jsonpath_exec.c.
References a, b, DatumGetInt32(), DirectFunctionCall2, numeric_cmp(), and NumericGetDatum().
Referenced by compareItems().
|
static |
Definition at line 3272 of file jsonpath_exec.c.
References binaryCompareStrings(), cmp(), GetDatabaseEncoding(), pfree(), pg_server_to_any(), PG_SQL_ASCII, and PG_UTF8.
Referenced by compareItems().
|
static |
Definition at line 3443 of file jsonpath_exec.c.
References palloc().
Referenced by executeAnyItem(), and executeNextItem().
|
static |
Definition at line 3034 of file jsonpath_exec.c.
References list_length().
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3201 of file jsonpath_exec.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, 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 1932 of file jsonpath_exec.c.
References Assert, check_stack_depth(), copyJsonbValue(), executeItemOptUnwrapTarget(), JsonPathExecContext::ignoreStructuralErrors, jbvBinary, jperIsError, jperNotFound, jperOk, JsonbIteratorInit(), JsonbIteratorNext(), JsonValueListAppend(), PG_UINT32_MAX, res, JsonbValue::type, JsonbValue::val, WJB_DONE, WJB_ELEM, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget(), and executeItemUnwrapTargetArray().
|
static |
Definition at line 2103 of file jsonpath_exec.c.
References ereport, errcode(), errmsg(), ERROR, error(), executeItemOptUnwrapResult(), executeNextItem(), getScalar(), jbvNumeric, jperError, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspOperationName(), jspThrowErrors, palloc(), res, RETURN_ERROR, JsonbValue::type, JsonPathItem::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1775 of file jsonpath_exec.c.
References JsonPathItem::base, check_stack_depth(), JsonPathItem::content, elog, ERROR, executeComparison(), executeItemOptUnwrapResultNoThrow(), executeLikeRegex(), executePredicate(), executeStartsWith(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, jperOk, jpiAnd, jpiEqual, jpiExists, jpiGreater, jpiGreaterOrEqual, jpiIsUnknown, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiNot, jpiNotEqual, jpiOr, jpiStartsWith, JsonValueListIsEmpty(), jspGetArg(), jspGetLeftArg(), jspGetRightArg(), jspHasNext, jspInitByBuffer(), jspStrictAbsenceOfErrors, JsonPathItem::like_regex, res, and JsonPathItem::type.
Referenced by executeItemOptUnwrapTarget(), and executeNestedBoolItem().
|
static |
Definition at line 3240 of file jsonpath_exec.c.
References cmp(), compareItems(), and JsonPathExecContext::useTz.
Referenced by executeBoolItem().
|
static |
Definition at line 2337 of file jsonpath_exec.c.
References AdjustTimeForTypmod(), AdjustTimestampForTypmod(), anytime_typmod_check(), anytimestamp_typmod_check(), JsonPathItem::arg, checkTimezoneIsUsedForCast(), collid, JsonPathItem::content, 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(), 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_opt_error(), palloc(), parse_datetime(), pfree(), POSTGRES_EPOCH_JDATE, res, 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, JsonbValue::type, JsonPathItem::type, JsonPathExecContext::useTz, JsonbValue::val, and value.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 733 of file jsonpath_exec.c.
References executeItemOptUnwrapTarget(), and jspAutoUnwrap.
Referenced by executeItemOptUnwrapResult(), executeJsonPath(), executeNextItem(), and getArrayIndex().
|
static |
Definition at line 1723 of file jsonpath_exec.c.
References Assert, executeItem(), executeItemUnwrapTargetArray(), jbvArray, jperIsError, jperOk, JsonbType(), JsonValueListAppend(), JsonValueListInitIterator(), JsonValueListNext(), jspAutoUnwrap, res, and JsonbValue::type.
Referenced by executeBinaryArithmExpr(), executeItemOptUnwrapResultNoThrow(), and executeUnaryArithmExpr().
|
static |
Definition at line 1758 of file jsonpath_exec.c.
References executeItemOptUnwrapResult(), res, and JsonPathExecContext::throwErrors.
Referenced by executeBoolItem(), and executePredicate().
|
static |
Definition at line 745 of file jsonpath_exec.c.
References JsonPathItem::anybounds, appendBoolResult(), JsonPathItem::args, JsonPathItem::array, Assert, JsonPathExecContext::baseObject, buf, CHECK_FOR_INTERRUPTS, check_stack_depth(), construct_array_builtin(), JsonPathItem::content, 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(), 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(), jspHasNext, jspIgnoreStructuralErrors, jspOperationName(), jspThrowErrors, sort-test::key, MAXDATELEN, numeric_abs(), numeric_add_opt_error(), numeric_ceil(), numeric_div_opt_error(), numeric_floor(), numeric_in(), numeric_int4_opt_error(), numeric_int8_opt_error(), numeric_is_inf(), numeric_is_nan(), numeric_mod_opt_error(), numeric_mul_opt_error(), numeric_out(), numeric_sub_opt_error(), numeric_uminus(), NumericGetDatum(), numerictypmodin(), palloc(), parse_bool(), pfree(), pg_ltoa(), pnstrdup(), PointerGetDatum(), pstrdup(), range(), res, RETURN_ERROR, JsonPathExecContext::root, scale, setBaseObject(), size, JsonbValue::type, JsonPathItem::type, JsonbValue::val, and val.
Referenced by executeAnyItem(), and executeItem().
|
static |
Definition at line 1672 of file jsonpath_exec.c.
References Assert, elog, ERROR, executeAnyItem(), jbvArray, jbvBinary, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), and executeNumericItemMethod().
|
static |
Definition at line 677 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, JsonPathExecContext::current, executeItem(), JsonPathExecContext::getVar, JsonPath::header, JsonBaseObjectInfo::id, JsonPathExecContext::ignoreStructuralErrors, JsonPathExecContext::innermostArraySize, JsonBaseObjectInfo::jbc, jperIsError, jperNotFound, jperOk, JsonbExtractScalar(), JsonbInitBinary(), JSONPATH_LAX, JsonValueListIsEmpty(), jspInit(), jspStrictAbsenceOfErrors, JsonPathExecContext::lastGeneratedObjectId, JsonPathExecContext::laxMode, res, 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 2818 of file jsonpath_exec.c.
References Assert, JsonPathExecContext::baseObject, ereport, errcode(), errmsg(), ERROR, executeNextItem(), JsonBaseObjectInfo::id, int64_to_numeric(), JsonBaseObjectInfo::jbc, jbvBinary, jbvNumeric, jbvObject, jbvString, jperIsError, jperNotFound, jperOk, JsonbInitBinary(), JsonbIteratorInit(), JsonbIteratorNext(), JsonbType(), JsonbValueToJsonb(), JsonContainerSize, jspGetNext(), jspOperationName(), sort-test::key, JsonPathExecContext::lastGeneratedObjectId, next, ps, pushJsonbValue(), res, RETURN_ERROR, setBaseObject(), JsonbValue::type, JsonPathItem::type, JsonbValue::val, val, WJB_BEGIN_OBJECT, WJB_DONE, WJB_END_OBJECT, WJB_KEY, and WJB_VALUE.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2265 of file jsonpath_exec.c.
References JsonLikeRegexContext::cflags, JsonPathItem::content, cstring_to_text_with_len(), getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, jspConvertRegexFlags(), JsonPathItem::like_regex, RE_compile_and_execute(), JsonLikeRegexContext::regex, and str.
Referenced by executeBoolItem().
|
static |
Definition at line 1911 of file jsonpath_exec.c.
References JsonPathExecContext::current, executeBoolItem(), and res.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 1692 of file jsonpath_exec.c.
References copyJsonbValue(), cur, executeItem(), jperOk, JsonValueListAppend(), jspGetNext(), jspHasNext, and next.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), and executeUnaryArithmExpr().
|
static |
Definition at line 2296 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemUnwrapTargetArray(), executeNextItem(), getScalar(), jbvArray, jbvNumeric, jperOk, JsonbType(), jspGetNext(), jspOperationName(), next, NumericGetDatum(), palloc(), RETURN_ERROR, JsonbValue::type, JsonPathItem::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2023 of file jsonpath_exec.c.
References error(), executeItemOptUnwrapResultNoThrow(), jpbFalse, jpbTrue, jpbUnknown, jperIsError, JsonValueListInitIterator(), JsonValueListNext(), jspStrictAbsenceOfErrors, and res.
Referenced by executeBoolItem().
|
static |
Definition at line 2241 of file jsonpath_exec.c.
References getScalar(), jbvString, jpbFalse, jpbTrue, jpbUnknown, and JsonbValue::val.
Referenced by executeBoolItem().
|
static |
Definition at line 2174 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, executeItemOptUnwrapResult(), executeNextItem(), getScalar(), jbvNumeric, jperIsError, jperNotFound, jperOk, JsonValueListInitIterator(), JsonValueListNext(), jspGetArg(), jspGetNext(), jspOperationName(), NumericGetDatum(), RETURN_ERROR, JsonPathItem::type, and val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3457 of file jsonpath_exec.c.
References DatumGetNumeric(), DirectFunctionCall2, ereport, errcode(), errmsg(), ERROR, executeItem(), getScalar(), Int32GetDatum(), jbvNumeric, jperIsError, jperOk, JsonValueListHead(), JsonValueListLength(), numeric_int4_opt_error(), numeric_trunc(), NumericGetDatum(), res, RETURN_ERROR, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 2956 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 2989 of file jsonpath_exec.c.
References JsonPathVariable::isnull, jbvNull, JsonItemFromDatum(), lfirst, JsonPathVariable::name, JsonPathVariable::namelen, palloc(), JsonbValue::type, JsonPathVariable::typid, JsonPathVariable::typmod, and JsonPathVariable::value.
Referenced by JsonPathExists(), JsonPathQuery(), JsonPathValue(), and JsonTableResetRowPattern().
|
static |
Definition at line 3139 of file jsonpath_exec.c.
References Assert, ereport, errcode(), errmsg(), ERROR, JsonPathExecContext::getVar, jpiVariable, jspGetString(), pnstrdup(), setBaseObject(), variable::type, value, and JsonPathExecContext::vars.
Referenced by getJsonPathItem().
|
static |
Definition at line 3171 of file jsonpath_exec.c.
References 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 4088 of file jsonpath_exec.c.
References elog, ERROR, if(), IsA, JSON_TABLE_EXEC_CONTEXT_MAGIC, and JsonTableExecContext::magic.
Referenced by JsonTableDestroyOpaque(), JsonTableFetchRow(), JsonTableGetValue(), and JsonTableSetDocument().
|
static |
Definition at line 3636 of file jsonpath_exec.c.
References Assert, 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 425 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
|
static |
Definition at line 397 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), getJsonPathVariableFromJsonb(), jperIsError, jperOk, PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, PG_RETURN_NULL, and res.
Referenced by jsonb_path_exists(), jsonb_path_exists_opr(), and jsonb_path_exists_tz().
Datum jsonb_path_exists_opr | ( | PG_FUNCTION_ARGS | ) |
Datum jsonb_path_exists_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 431 of file jsonpath_exec.c.
References jsonb_path_exists_internal().
Datum jsonb_path_match | ( | PG_FUNCTION_ARGS | ) |
Definition at line 495 of file jsonpath_exec.c.
References jsonb_path_match_internal().
|
static |
Definition at line 454 of file jsonpath_exec.c.
References countVariablesFromJsonb(), ereport, errcode(), errmsg(), ERROR, executeJsonPath(), getJsonPathVariableFromJsonb(), jbvBool, jbvNull, JsonValueListHead(), JsonValueListLength(), PG_FREE_IF_COPY, PG_GETARG_BOOL, PG_GETARG_JSONB_P, PG_GETARG_JSONPATH_P, PG_NARGS, PG_RETURN_BOOL, PG_RETURN_NULL, JsonbValue::type, and JsonbValue::val.
Referenced by jsonb_path_match(), jsonb_path_match_opr(), and jsonb_path_match_tz().
Datum jsonb_path_match_opr | ( | PG_FUNCTION_ARGS | ) |
Datum jsonb_path_match_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 501 of file jsonpath_exec.c.
References jsonb_path_match_internal().
Datum jsonb_path_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 572 of file jsonpath_exec.c.
References jsonb_path_query_internal().
Datum jsonb_path_query_array | ( | PG_FUNCTION_ARGS | ) |
Definition at line 605 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
|
static |
Definition at line 589 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), 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 611 of file jsonpath_exec.c.
References jsonb_path_query_array_internal().
Datum jsonb_path_query_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 641 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 622 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), getJsonPathVariableFromJsonb(), JsonbValueToJsonb(), JsonValueListHead(), JsonValueListLength(), 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 647 of file jsonpath_exec.c.
References jsonb_path_query_first_internal().
|
static |
Definition at line 524 of file jsonpath_exec.c.
References countVariablesFromJsonb(), executeJsonPath(), getJsonPathVariableFromJsonb(), JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListGetList(), lfirst, list_delete_first(), list_head(), MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, 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, SRF_RETURN_NEXT, and FuncCallContext::user_fctx.
Referenced by jsonb_path_query(), and jsonb_path_query_tz().
Datum jsonb_path_query_tz | ( | PG_FUNCTION_ARGS | ) |
Definition at line 578 of file jsonpath_exec.c.
References jsonb_path_query_internal().
|
static |
Definition at line 3223 of file jsonpath_exec.c.
References Assert, jbvArray, jbvBinary, JsonContainerIsArray, JsonContainerIsScalar, JsonContainerSize, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapTarget().
|
static |
Definition at line 3599 of file jsonpath_exec.c.
References jbvBinary, Jsonb::root, JsonbValue::type, JsonbValue::val, and VARSIZE_ANY_EXHDR.
Referenced by executeJsonPath(), executeKeyValueMethod(), getJsonPathVariableFromJsonb(), and JsonItemFromDatum().
|
static |
Definition at line 3612 of file jsonpath_exec.c.
References Assert, elog, ERROR, JsonbContainer::header, jbvArray, jbvBinary, jbvObject, JsonContainerIsArray, JsonContainerIsObject, JsonContainerIsScalar, type, JsonbValue::type, and JsonbValue::val.
Referenced by executeItemOptUnwrapResult(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), and executeNumericItemMethod().
|
static |
Definition at line 3129 of file jsonpath_exec.c.
References DatumGetNumeric(), jbvNumeric, JsonbValue::type, and JsonbValue::val.
Referenced by JsonItemFromDatum().
|
static |
Definition at line 3047 of file jsonpath_exec.c.
References Assert, CStringGetDatum(), DatumGetBool(), DatumGetJsonbP(), DatumGetTextP, DirectFunctionCall1, ereport, errcode(), errmsg(), ERROR, float4_numeric(), float8_numeric(), format_type_be(), int2_numeric(), int4_numeric(), int8_numeric(), jbvBool, jbvDatetime, jbvString, jsonb_in(), JsonbExtractScalar(), JsonbInitBinary(), JsonbPGetDatum(), JsonbValueInitNumericDatum(), JsonContainerIsScalar, pfree(), PG_USED_FOR_ASSERTS_ONLY, res, Jsonb::root, str, text_to_cstring(), val, VARDATA_ANY, and VARSIZE_ANY_EXHDR.
Referenced by GetJsonPathVar().
Definition at line 3886 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), error(), executeJsonPath(), GetJsonPathVar(), jperIsError, jperOk, and res.
Referenced by ExecEvalJsonExprPath().
Datum JsonPathQuery | ( | Datum | jb, |
JsonPath * | jp, | ||
JsonWrapper | wrapper, | ||
bool * | empty, | ||
bool * | error, | ||
List * | vars, | ||
const char * | column_name | ||
) |
Definition at line 3909 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, error(), executeJsonPath(), GetJsonPathVar(), jperIsError, JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListHead(), JsonValueListLength(), JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, JSW_UNSPEC, PointerGetDatum(), res, and wrapItemsInArray().
Referenced by ExecEvalJsonExprPath().
JsonbValue* JsonPathValue | ( | Datum | jb, |
JsonPath * | jp, | ||
bool * | empty, | ||
bool * | error, | ||
List * | vars, | ||
const char * | column_name | ||
) |
Definition at line 4003 of file jsonpath_exec.c.