33 #define JsonbContainsStrategyNumber 7
34 #define JsonbExistsStrategyNumber 9
35 #define JsonbExistsAnyStrategyNumber 10
36 #define JsonbExistsAllStrategyNumber 11
59 #define JGINFLAG_KEY 0x01
60 #define JGINFLAG_NULL 0x02
61 #define JGINFLAG_BOOL 0x03
62 #define JGINFLAG_NUM 0x04
63 #define JGINFLAG_STR 0x05
64 #define JGINFLAG_HASHED 0x10
65 #define JGIN_MAXLENGTH 125
68 #define DatumGetJsonb(d) ((Jsonb *) PG_DETOAST_DATUM(d))
69 #define JsonbGetDatum(p) PointerGetDatum(p)
70 #define PG_GETARG_JSONB(x) DatumGetJsonb(PG_GETARG_DATUM(x))
71 #define PG_RETURN_JSONB(x) PG_RETURN_POINTER(x)
141 #define JENTRY_OFFLENMASK 0x0FFFFFFF
142 #define JENTRY_TYPEMASK 0x70000000
143 #define JENTRY_HAS_OFF 0x80000000
146 #define JENTRY_ISSTRING 0x00000000
147 #define JENTRY_ISNUMERIC 0x10000000
148 #define JENTRY_ISBOOL_FALSE 0x20000000
149 #define JENTRY_ISBOOL_TRUE 0x30000000
150 #define JENTRY_ISNULL 0x40000000
151 #define JENTRY_ISCONTAINER 0x50000000
154 #define JBE_OFFLENFLD(je_) ((je_) & JENTRY_OFFLENMASK)
155 #define JBE_HAS_OFF(je_) (((je_) & JENTRY_HAS_OFF) != 0)
156 #define JBE_ISSTRING(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISSTRING)
157 #define JBE_ISNUMERIC(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISNUMERIC)
158 #define JBE_ISCONTAINER(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISCONTAINER)
159 #define JBE_ISNULL(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISNULL)
160 #define JBE_ISBOOL_TRUE(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISBOOL_TRUE)
161 #define JBE_ISBOOL_FALSE(je_) (((je_) & JENTRY_TYPEMASK) == JENTRY_ISBOOL_FALSE)
162 #define JBE_ISBOOL(je_) (JBE_ISBOOL_TRUE(je_) || JBE_ISBOOL_FALSE(je_))
165 #define JBE_ADVANCE_OFFSET(offset, je) \
168 if (JBE_HAS_OFF(je_)) \
169 (offset) = JBE_OFFLENFLD(je_); \
171 (offset) += JBE_OFFLENFLD(je_); \
181 #define JB_OFFSET_STRIDE 32
203 #define JB_CMASK 0x0FFFFFFF
204 #define JB_FSCALAR 0x10000000
205 #define JB_FOBJECT 0x20000000
206 #define JB_FARRAY 0x40000000
216 #define JB_ROOT_COUNT(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_CMASK)
217 #define JB_ROOT_IS_SCALAR(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FSCALAR)
218 #define JB_ROOT_IS_OBJECT(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FOBJECT)
219 #define JB_ROOT_IS_ARRAY(jbp_) ( *(uint32*) VARDATA(jbp_) & JB_FARRAY)
275 #define IsAJsonbScalar(jsonbval) ((jsonbval)->type >= jbvNull && \
276 (jsonbval)->type <= jbvBool)
char * JsonbToCStringIndent(StringInfo out, JsonbContainer *in, int estimated_len)
Datum jsonb_eq(PG_FUNCTION_ARGS)
JEntry children[FLEXIBLE_ARRAY_MEMBER]
Datum jsonb_delete(PG_FUNCTION_ARGS)
Datum jsonb_contained(PG_FUNCTION_ARGS)
Datum jsonb_le(PG_FUNCTION_ARGS)
Datum jsonb_hash(PG_FUNCTION_ARGS)
Datum jsonb_build_object(PG_FUNCTION_ARGS)
struct JsonbParseState JsonbParseState
JsonbIterator * JsonbIteratorInit(JsonbContainer *container)
Datum gin_extract_jsonb_query_path(PG_FUNCTION_ARGS)
Datum jsonb_typeof(PG_FUNCTION_ARGS)
Datum jsonb_object_two_arg(PG_FUNCTION_ARGS)
Datum gin_extract_jsonb_query(PG_FUNCTION_ARGS)
Datum gin_extract_jsonb_path(PG_FUNCTION_ARGS)
int compareJsonbContainers(JsonbContainer *a, JsonbContainer *b)
uint32 getJsonbLength(const JsonbContainer *jc, int index)
Datum jsonb_ge(PG_FUNCTION_ARGS)
char * JsonbToCString(StringInfo out, JsonbContainer *in, int estimated_len)
Datum jsonb_object_agg_transfn(PG_FUNCTION_ARGS)
struct JsonbContainer JsonbContainer
Datum jsonb_build_array(PG_FUNCTION_ARGS)
JsonbValue * findJsonbValueFromContainer(JsonbContainer *sheader, uint32 flags, JsonbValue *key)
struct JsonbParseState * next
Datum jsonb_exists_all(PG_FUNCTION_ARGS)
Datum gin_consistent_jsonb(PG_FUNCTION_ARGS)
JsonbValue * getIthJsonbValueFromContainer(JsonbContainer *sheader, uint32 i)
void JsonbHashScalarValue(const JsonbValue *scalarVal, uint32 *hash)
Datum jsonb_recv(PG_FUNCTION_ARGS)
Datum jsonb_out(PG_FUNCTION_ARGS)
Datum jsonb_lt(PG_FUNCTION_ARGS)
Datum to_jsonb(PG_FUNCTION_ARGS)
Datum jsonb_object_agg_finalfn(PG_FUNCTION_ARGS)
Datum gin_triconsistent_jsonb(PG_FUNCTION_ARGS)
Datum jsonb_ne(PG_FUNCTION_ARGS)
struct JsonbIterator JsonbIterator
JsonbContainer * container
Datum gin_compare_jsonb(PG_FUNCTION_ARGS)
Datum gin_consistent_jsonb_path(PG_FUNCTION_ARGS)
Datum jsonb_delete_path(PG_FUNCTION_ARGS)
Datum jsonb_build_array_noargs(PG_FUNCTION_ARGS)
Datum jsonb_in(PG_FUNCTION_ARGS)
struct JsonbValue::@71::@72 string
Datum gin_extract_jsonb(PG_FUNCTION_ARGS)
Datum jsonb_delete_idx(PG_FUNCTION_ARGS)
struct JsonbValue::@71::@73 array
Datum jsonb_pretty(PG_FUNCTION_ARGS)
Datum jsonb_exists(PG_FUNCTION_ARGS)
Datum jsonb_insert(PG_FUNCTION_ARGS)
Datum jsonb_exists_any(PG_FUNCTION_ARGS)
Datum jsonb_send(PG_FUNCTION_ARGS)
JsonbValue * pushJsonbValue(JsonbParseState **pstate, JsonbIteratorToken seq, JsonbValue *jbVal)
Jsonb * JsonbValueToJsonb(JsonbValue *val)
Datum jsonb_contains(PG_FUNCTION_ARGS)
JsonbIteratorToken JsonbIteratorNext(JsonbIterator **it, JsonbValue *val, bool skipNested)
struct JsonbValue::@71::@74 object
struct JsonbIterator * parent
Datum jsonb_agg_transfn(PG_FUNCTION_ARGS)
Datum jsonb_build_object_noargs(PG_FUNCTION_ARGS)
Datum jsonb_concat(PG_FUNCTION_ARGS)
bool JsonbDeepContains(JsonbIterator **val, JsonbIterator **mContained)
Datum jsonb_set(PG_FUNCTION_ARGS)
Datum jsonb_cmp(PG_FUNCTION_ARGS)
struct JsonbValue::@71::@75 binary
Datum jsonb_gt(PG_FUNCTION_ARGS)
Datum gin_triconsistent_jsonb_path(PG_FUNCTION_ARGS)
static unsigned hash(unsigned *uv, int n)
enum JsonbValue::@70 type
Datum jsonb_agg_finalfn(PG_FUNCTION_ARGS)
uint32 getJsonbOffset(const JsonbContainer *jc, int index)
Datum jsonb_object(PG_FUNCTION_ARGS)