79 int nestingLevel,
bool insideArraySubscript);
120 elog(
ERROR,
"unsupported jsonpath version number: %d", version);
181 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
182 errmsg(
"invalid input syntax for type %s: \"%s\"",
"jsonpath",
230 int nestingLevel,
bool insideArraySubscript)
236 int argNestingLevel = 0;
300 nestingLevel + argNestingLevel,
301 insideArraySubscript);
302 *(
int32 *) (buf->
data + left) = chld - pos;
306 nestingLevel + argNestingLevel,
307 insideArraySubscript);
308 *(
int32 *) (buf->
data + right) = chld - pos;
328 insideArraySubscript);
329 *(
int32 *) (buf->
data + offs) = chld - pos;
346 nestingLevel + argNestingLevel,
347 insideArraySubscript);
348 *(
int32 *) (buf->
data + arg) = chld - pos;
359 if (nestingLevel <= 0)
361 (
errcode(ERRCODE_SYNTAX_ERROR),
362 errmsg(
"@ is not allowed in root expressions")));
365 if (!insideArraySubscript)
367 (
errcode(ERRCODE_SYNTAX_ERROR),
368 errmsg(
"LAST is allowed only in array subscripts")));
382 for (i = 0; i < nelems; i++)
389 nestingLevel,
true) - pos;
394 nestingLevel,
true) - pos;
422 elog(
ERROR,
"unrecognized jsonpath item type: %d", item->
type);
428 insideArraySubscript) - pos;
751 return "starts with";
771 elog(
ERROR,
"unrecognized jsonpath item type: %d", type);
814 #define read_byte(v, b, p) do { \ 815 (v) = *(uint8*)((b) + (p)); \ 819 #define read_int32(v, b, p) do { \ 820 (v) = *(uint32*)((b) + (p)); \ 821 (p) += sizeof(int32); \ 824 #define read_int32_n(v, b, p, n) do { \ 825 (v) = (void *)((b) + (p)); \ 826 (p) += sizeof(int32) * (n); \ 845 v->
base = base + pos;
848 pos =
INTALIGN((uintptr_t) (base + pos)) - (uintptr_t) base;
struct JsonPathParseItem::@136::@137 args
struct JsonPathParseItem::@136::@141 string
Datum jsonpath_recv(PG_FUNCTION_ARGS)
#define read_int32(v, b, p)
void escape_json(StringInfo buf, const char *str)
bool jspGetNext(JsonPathItem *v, JsonPathItem *a)
JsonPathParseResult * parsejsonpath(const char *str, int len)
#define NumericGetDatum(X)
StringInfoData * StringInfo
Datum numeric_out(PG_FUNCTION_ARGS)
void jspInitByBuffer(JsonPathItem *v, char *base, int32 pos)
int errcode(int sqlerrcode)
static char * jsonPathToCstring(StringInfo out, JsonPath *in, int estimated_len)
#define PG_GETARG_POINTER(n)
#define DirectFunctionCall1(func, arg1)
#define PG_RETURN_BYTEA_P(x)
#define appendStringInfoCharMacro(str, ch)
#define PG_RETURN_JSONPATH_P(p)
void pfree(void *pointer)
void appendStringInfo(StringInfo str, const char *fmt,...)
#define DatumGetCString(X)
Datum jsonpath_send(PG_FUNCTION_ARGS)
static void alignStringInfoInt(StringInfo buf)
struct JsonPathParseItem::@136::@139 anybounds
void appendStringInfoString(StringInfo str, const char *s)
void check_stack_depth(void)
struct JsonPathItem::@129::@131 array
struct JsonPathItem::@129::@130 args
static Datum jsonPathFromCstring(char *in, int len)
void enlargeStringInfo(StringInfo str, int needed)
struct JsonPathParseItem::@136::@138 array
static struct cvec * range(struct vars *v, chr a, chr b, int cases)
struct JsonPathItem::@129::@132 anybounds
#define PG_GETARG_JSONPATH_P(x)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
struct JsonPathItem::@129::@134 like_regex
union JsonPathItem::@129 content
const char * jspOperationName(JsonPathItemType type)
#define read_int32_n(v, b, p, n)
void jspGetRightArg(JsonPathItem *v, JsonPathItem *a)
Datum jsonpath_in(PG_FUNCTION_ARGS)
union JsonPathParseItem::@136 value
void appendStringInfoSpaces(StringInfo str, int count)
bool jspGetBool(JsonPathItem *v)
#define ereport(elevel,...)
bool jspGetArraySubscript(JsonPathItem *v, JsonPathItem *from, JsonPathItem *to, int i)
void jspGetLeftArg(JsonPathItem *v, JsonPathItem *a)
#define Assert(condition)
#define PG_RETURN_CSTRING(x)
char data[FLEXIBLE_ARRAY_MEMBER]
static int flattenJsonPathParseItem(StringInfo buf, JsonPathParseItem *item, int nestingLevel, bool insideArraySubscript)
static int32 reserveSpaceForItemPointer(StringInfo buf)
static int operationPriority(JsonPathItemType op)
Datum jsonpath_out(PG_FUNCTION_ARGS)
int errmsg(const char *fmt,...)
void jspInit(JsonPathItem *v, JsonPath *js)
#define PG_GETARG_CSTRING(n)
#define read_byte(v, b, p)
#define CHECK_FOR_INTERRUPTS()
static void printJsonPathItem(StringInfo buf, JsonPathItem *v, bool inKey, bool printBracketes)
#define SET_VARSIZE(PTR, len)
struct JsonPathItem::@129::@133 value
void jspGetArg(JsonPathItem *v, JsonPathItem *a)
struct JsonPathParseItem::@136::@140 like_regex
char * jspGetString(JsonPathItem *v, int32 *len)
void appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
Numeric jspGetNumeric(JsonPathItem *v)