|
PostgreSQL Source Code git master
|
#include "executor/tablefunc.h"#include "fmgr.h"#include "nodes/pg_list.h"#include "nodes/primnodes.h"#include "utils/jsonb.h"

Go to the source code of this file.
Data Structures | |
| struct | JsonPath |
| struct | JsonPathItem |
| struct | JsonPathParseItem |
| struct | JsonPathParseResult |
| struct | JsonPathVariable |
Macros | |
| #define | JSONPATH_VERSION (0x01) |
| #define | JSONPATH_LAX (0x80000000) |
| #define | JSONPATH_HDRSZ (offsetof(JsonPath, data)) |
| #define | PG_GETARG_JSONPATH_P(x) DatumGetJsonPathP(PG_GETARG_DATUM(x)) |
| #define | PG_GETARG_JSONPATH_P_COPY(x) DatumGetJsonPathPCopy(PG_GETARG_DATUM(x)) |
| #define | PG_RETURN_JSONPATH_P(p) PG_RETURN_POINTER(p) |
| #define | jspIsScalar(type) ((type) >= jpiNull && (type) <= jpiBool) |
| #define | JSP_REGEX_ICASE 0x01 /* i flag, case insensitive */ |
| #define | JSP_REGEX_DOTALL 0x02 /* s flag, dot matches newline */ |
| #define | JSP_REGEX_MLINE 0x04 /* m flag, ^/$ match at newlines */ |
| #define | JSP_REGEX_WSPACE 0x08 /* x flag, ignore whitespace in pattern */ |
| #define | JSP_REGEX_QUOTE 0x10 /* q flag, no special characters */ |
| #define | jspHasNext(jsp) ((jsp)->nextPos > 0) |
Typedefs | |
| typedef enum JsonPathItemType | JsonPathItemType |
| typedef struct JsonPathItem | JsonPathItem |
| typedef struct JsonPathParseItem | JsonPathParseItem |
| typedef struct JsonPathParseResult | JsonPathParseResult |
| typedef struct JsonPathVariable | JsonPathVariable |
Enumerations | |
| enum | JsonPathItemType { jpiNull = jbvNull , jpiString = jbvString , jpiNumeric = jbvNumeric , jpiBool = jbvBool , jpiAnd , jpiOr , jpiNot , jpiIsUnknown , jpiEqual , jpiNotEqual , jpiLess , jpiGreater , jpiLessOrEqual , jpiGreaterOrEqual , jpiAdd , jpiSub , jpiMul , jpiDiv , jpiMod , jpiPlus , jpiMinus , jpiAnyArray , jpiAnyKey , jpiIndexArray , jpiAny , jpiKey , jpiCurrent , jpiRoot , jpiVariable , jpiFilter , jpiExists , jpiType , jpiSize , jpiAbs , jpiFloor , jpiCeiling , jpiDouble , jpiDatetime , jpiKeyValue , jpiSubscript , jpiLast , jpiStartsWith , jpiLikeRegex , jpiBigint , jpiBoolean , jpiDate , jpiDecimal , jpiInteger , jpiNumber , jpiStringFunc , jpiTime , jpiTimeTz , jpiTimestamp , jpiTimestampTz , jpiStrReplace , jpiStrLower , jpiStrUpper , jpiStrLtrim , jpiStrRtrim , jpiStrBtrim , jpiStrInitcap , jpiStrSplitPart } |
Variables | |
| PGDLLIMPORT const TableFuncRoutine | JsonbTableRoutine |
| #define JSONPATH_LAX (0x80000000) |
Definition at line 31 of file jsonpath.h.
| #define JSONPATH_VERSION (0x01) |
Definition at line 30 of file jsonpath.h.
Definition at line 130 of file jsonpath.h.
| #define JSP_REGEX_ICASE 0x01 /* i flag, case insensitive */ |
Definition at line 129 of file jsonpath.h.
Definition at line 131 of file jsonpath.h.
| #define JSP_REGEX_QUOTE 0x10 /* q flag, no special characters */ |
Definition at line 133 of file jsonpath.h.
| #define JSP_REGEX_WSPACE 0x08 /* x flag, ignore whitespace in pattern */ |
Definition at line 132 of file jsonpath.h.
Definition at line 202 of file jsonpath.h.
Definition at line 50 of file jsonpath.h.
| #define PG_GETARG_JSONPATH_P | ( | x | ) | DatumGetJsonPathP(PG_GETARG_DATUM(x)) |
Definition at line 46 of file jsonpath.h.
| #define PG_GETARG_JSONPATH_P_COPY | ( | x | ) | DatumGetJsonPathPCopy(PG_GETARG_DATUM(x)) |
Definition at line 47 of file jsonpath.h.
| #define PG_RETURN_JSONPATH_P | ( | p | ) | PG_RETURN_POINTER(p) |
Definition at line 48 of file jsonpath.h.
| typedef struct JsonPathItem JsonPathItem |
Definition at line 223 of file jsonpath.h.
Definition at line 62 of file jsonpath.h.
Definition at line 35 of file jsonpath.h.
References PG_DETOAST_DATUM.
Referenced by contain_mutable_functions_walker(), ExecEvalJsonExprPath(), and JsonTableInitPlan().
Definition at line 4202 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, and jperOk.
Referenced by ExecEvalJsonExprPath().
|
extern |
Definition at line 4225 of file jsonpath_exec.c.
References Assert, CountJsonPathVars(), DatumGetJsonbP(), elog, ereport, errcode(), errhint(), errmsg, ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), jperIsError, JsonbPGetDatum(), JsonbValueToJsonb(), JsonValueListHasMultipleItems(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsEmpty(), JSW_CONDITIONAL, JSW_NONE, JSW_UNCONDITIONAL, JSW_UNSPEC, PointerGetDatum(), and wrapItemsInArray().
Referenced by ExecEvalJsonExprPath().
|
extern |
Definition at line 4315 of file jsonpath_exec.c.
References Assert, copyJsonbValue(), CountJsonPathVars(), DatumGetJsonbP(), ereport, errcode(), errmsg, ERROR, error(), executeJsonPath(), fb(), GetJsonPathVar(), IsAJsonbScalar, jbvBinary, jbvNull, jperIsError, JsonbExtractScalar(), JsonContainerIsScalar, JsonValueListHasMultipleItems(), JsonValueListHead(), JsonValueListInit(), JsonValueListIsEmpty(), PG_USED_FOR_ASSERTS_ONLY, JsonbValue::type, and JsonbValue::val.
Referenced by ExecEvalJsonExprPath().
Referenced by executeLikeRegex().
|
extern |
Definition at line 1167 of file jsonpath.c.
References a, JsonPathItem::arg, Assert, JsonPathItem::base, JsonPathItem::content, jpiDatetime, jpiExists, jpiFilter, jpiIsUnknown, jpiMinus, jpiNot, jpiPlus, jpiStrBtrim, jpiStrLtrim, jpiStrRtrim, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeBoolItem(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeStringInternalMethod(), executeUnaryArithmExpr(), extract_jsp_bool_expr(), extract_jsp_path_expr_nodes(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1339 of file jsonpath.c.
References JsonPathItem::array, Assert, JsonPathItem::base, JsonPathItem::content, JsonPathItem::elems, i, jpiIndexArray, jspInitByBuffer(), and JsonPathItem::type.
Referenced by executeItemOptUnwrapTarget(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1311 of file jsonpath.c.
References Assert, JsonPathItem::content, JsonPathItem::data, jpiBool, JsonPathItem::type, and JsonPathItem::value.
Referenced by getJsonPathItem(), and printJsonPathItem().
|
extern |
Definition at line 1263 of file jsonpath.c.
References a, JsonPathItem::args, Assert, JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDecimal, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiStrReplace, jpiStrSplitPart, jpiSub, jspInitByBuffer(), JsonPathItem::left, and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), executeItemOptUnwrapTarget(), executeStringInternalMethod(), extract_jsp_bool_expr(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1188 of file jsonpath.c.
References a, Assert, JsonPathItem::base, 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, jspHasNext, jspInitByBuffer(), JsonPathItem::nextPos, and JsonPathItem::type.
Referenced by appendBoolResult(), executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNextItem(), executeNumericItemMethod(), executeStringInternalMethod(), executeUnaryArithmExpr(), extract_jsp_path_expr_nodes(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1319 of file jsonpath.c.
References Assert, JsonPathItem::content, JsonPathItem::data, jpiNumeric, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeStringInternalMethod(), getJsonPathItem(), and printJsonPathItem().
|
extern |
Definition at line 1287 of file jsonpath.c.
References a, JsonPathItem::args, Assert, JsonPathItem::base, JsonPathItem::content, jpiAdd, jpiAnd, jpiDecimal, jpiDiv, jpiEqual, jpiGreater, jpiGreaterOrEqual, jpiLess, jpiLessOrEqual, jpiMod, jpiMul, jpiNotEqual, jpiOr, jpiStartsWith, jpiStrReplace, jpiStrSplitPart, jpiSub, jspInitByBuffer(), JsonPathItem::right, and JsonPathItem::type.
Referenced by executeBinaryArithmExpr(), executeBoolItem(), executeItemOptUnwrapTarget(), executeStringInternalMethod(), extract_jsp_bool_expr(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1327 of file jsonpath.c.
References Assert, JsonPathItem::content, JsonPathItem::data, JsonPathItem::datalen, jpiKey, jpiString, jpiVariable, len, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeStringInternalMethod(), getJsonPathItem(), getJsonPathVariable(), jsonb_ops__add_path_item(), jsonb_path_ops__add_path_item(), jspIsMutableWalker(), and printJsonPathItem().
|
extern |
Definition at line 1058 of file jsonpath.c.
References Assert, JsonPath::data, JsonPath::header, JSONPATH_LAX, JSONPATH_VERSION, and jspInitByBuffer().
Referenced by executeJsonPath(), extract_jsp_query(), jsonPathToCstring(), and jspIsMutable().
|
extern |
Definition at line 1068 of file jsonpath.c.
References JsonPathItem::anybounds, JsonPathItem::arg, JsonPathItem::args, JsonPathItem::array, JsonPathItem::base, JsonPathItem::content, JsonPathItem::data, JsonPathItem::datalen, JsonPathItem::elems, elog, ERROR, JsonPathItem::expr, fb(), JsonPathItem::first, JsonPathItem::flags, INTALIGN, 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, JsonPathItem::last, JsonPathItem::left, JsonPathItem::like_regex, JsonPathItem::nelems, JsonPathItem::nextPos, JsonPathItem::pattern, JsonPathItem::patternlen, pg_fallthrough, read_byte, read_int32, read_int32_n, JsonPathItem::right, JsonPathItem::type, and JsonPathItem::value.
Referenced by executeBoolItem(), jspGetArg(), jspGetArraySubscript(), jspGetLeftArg(), jspGetNext(), jspGetRightArg(), jspInit(), jspIsMutableWalker(), and printJsonPathItem().
Definition at line 1381 of file jsonpath.c.
References JsonPathMutableContext::current, fb(), JsonPath::header, jpdsNonDateTime, JSONPATH_LAX, jspInit(), jspIsMutableWalker(), JsonPathMutableContext::lax, JsonPathMutableContext::mutable, JsonPathMutableContext::varexprs, and JsonPathMutableContext::varnames.
Referenced by contain_mutable_functions_walker().
|
extern |
Definition at line 905 of file jsonpath.c.
References elog, ERROR, fb(), jpiAbs, jpiAdd, jpiAnd, jpiBigint, jpiBoolean, jpiCeiling, jpiDate, jpiDatetime, jpiDecimal, jpiDiv, jpiDouble, jpiEqual, jpiFloor, jpiGreater, jpiGreaterOrEqual, jpiInteger, jpiKeyValue, jpiLess, jpiLessOrEqual, jpiLikeRegex, jpiMinus, jpiMod, jpiMul, jpiNotEqual, jpiNumber, jpiOr, jpiPlus, jpiSize, jpiStartsWith, jpiStrBtrim, jpiStringFunc, jpiStrInitcap, jpiStrLower, jpiStrLtrim, jpiStrReplace, jpiStrRtrim, jpiStrSplitPart, jpiStrUpper, jpiSub, jpiTime, jpiTimestamp, jpiTimestampTz, jpiTimeTz, jpiType, and type.
Referenced by executeBinaryArithmExpr(), executeDateTimeMethod(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), executeNumericItemMethod(), executeStringInternalMethod(), executeUnaryArithmExpr(), and printJsonPathItem().
|
extern |
Definition at line 536 of file jsonpath_scan.l.
References elog, ERROR, fb(), jsonpath_yyerror(), jsonpath_yyparse(), len, parseresult, and str.
Referenced by jsonPathFromCstring().
|
extern |
Definition at line 400 of file jsonpath_exec.c.
Referenced by ExecInitTableFuncScan().