80 struct Node *escontext,
82 int nestingLevel,
bool insideArraySubscript);
123 elog(
ERROR,
"unsupported jsonpath version number: %d", version);
182 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
183 errmsg(
"invalid input syntax for type %s: \"%s\"",
"jsonpath",
192 jsonpath->
expr, 0,
false))
239 bool insideArraySubscript)
245 int argNestingLevel = 0;
311 nestingLevel + argNestingLevel,
312 insideArraySubscript))
314 *(
int32 *) (
buf->data + left) = chld - pos;
320 nestingLevel + argNestingLevel,
321 insideArraySubscript))
323 *(
int32 *) (
buf->data + right) = chld - pos;
344 insideArraySubscript))
346 *(
int32 *) (
buf->data + offs) = chld - pos;
365 nestingLevel + argNestingLevel,
366 insideArraySubscript))
379 if (nestingLevel <= 0)
381 (
errcode(ERRCODE_SYNTAX_ERROR),
382 errmsg(
"@ is not allowed in root expressions")));
385 if (!insideArraySubscript)
387 (
errcode(ERRCODE_SYNTAX_ERROR),
388 errmsg(
"LAST is allowed only in array subscripts")));
402 for (
i = 0;
i < nelems;
i++)
449 elog(
ERROR,
"unrecognized jsonpath item type: %d", item->
type);
455 item->
next, nestingLevel,
456 insideArraySubscript))
787 return "starts with";
850 #define read_byte(v, b, p) do { \
851 (v) = *(uint8*)((b) + (p)); \
855 #define read_int32(v, b, p) do { \
856 (v) = *(uint32*)((b) + (p)); \
857 (p) += sizeof(int32); \
860 #define read_int32_n(v, b, p, n) do { \
861 (v) = (void *)((b) + (p)); \
862 (p) += sizeof(int32) * (n); \
881 v->
base = base + pos;
884 pos =
INTALIGN((uintptr_t) (base + pos)) - (uintptr_t) base;
Datum numeric_out(PG_FUNCTION_ARGS)
static void PGresult * res
elog(ERROR, "%s: %s", p2, msg)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define DirectFunctionCall1(func, arg1)
#define PG_GETARG_CSTRING(n)
void escape_json(StringInfo buf, const char *str)
void jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
void jspGetArg(JsonPathItem *v, JsonPathItem *a)
static Datum jsonPathFromCstring(char *in, int len, struct Node *escontext)
Datum jsonpath_send(PG_FUNCTION_ARGS)
#define read_byte(v, b, p)
#define read_int32_n(v, b, p, n)
Datum jsonpath_out(PG_FUNCTION_ARGS)
static void alignStringInfoInt(StringInfo buf)
void jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
bool jspGetBool(JsonPathItem *v)
void jspInit(JsonPathItem *v, JsonPath *js)
static bool flattenJsonPathParseItem(StringInfo buf, int *result, struct Node *escontext, JsonPathParseItem *item, int nestingLevel, bool insideArraySubscript)
const char * jspOperationName(JsonPathItemType type)
Numeric jspGetNumeric(JsonPathItem *v)
bool jspGetArraySubscript(JsonPathItem *v, JsonPathItem *from, JsonPathItem *to, int i)
static void printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, bool printBracketes)
#define read_int32(v, b, p)
bool jspGetNext(JsonPathItem *v, JsonPathItem *a)
static int operationPriority(JsonPathItemType op)
Datum jsonpath_recv(PG_FUNCTION_ARGS)
Datum jsonpath_in(PG_FUNCTION_ARGS)
void jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
char * jspGetString(JsonPathItem *v, int32 *len)
static int32 reserveSpaceForItemPointer(StringInfo buf)
static char * jsonPathToCstring(StringInfo out, JsonPath *in, int estimated_len)
#define PG_RETURN_JSONPATH_P(p)
JsonPathParseResult * parsejsonpath(const char *str, int len, struct Node *escontext)
#define PG_GETARG_JSONPATH_P(x)
Assert(fmt[strlen(fmt) - 1] !='\n')
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
#define SOFT_ERROR_OCCURRED(escontext)
static Datum NumericGetDatum(Numeric X)
void check_stack_depth(void)
static char * DatumGetCString(Datum X)
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
void appendStringInfo(StringInfo str, const char *fmt,...)
void enlargeStringInfo(StringInfo str, int needed)
void appendBinaryStringInfo(StringInfo str, const void *data, int datalen)
void appendStringInfoSpaces(StringInfo str, int count)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
StringInfoData * StringInfo
#define appendStringInfoCharMacro(str, ch)
struct JsonPathItem::@131::@134 anybounds
struct JsonPathItem::@131::@136 like_regex
struct JsonPathItem::@131::@133 array
struct JsonPathItem::@131::@135 value
union JsonPathItem::@131 content
struct JsonPathItem::@131::@132 args
struct JsonPathParseItem::@138::@141 anybounds
struct JsonPathParseItem::@138::@140 array
struct JsonPathParseItem::@138::@143 string
struct JsonPathParseItem::@138::@139 args
struct JsonPathParseItem::@138::@142 like_regex
union JsonPathParseItem::@138 value
char data[FLEXIBLE_ARRAY_MEMBER]
#define SET_VARSIZE(PTR, len)