@@ -81,51 +81,32 @@ typedef struct Json
81
81
82
82
#define JsonIsTemporary (json ) ((json)->obj.isTemporary)
83
83
84
- #ifndef JSONXOID
85
- # define JSONXOID JSONBOID
86
- #endif
87
-
88
- #ifndef JsonxContainerOps
89
- # define JsonxContainerOps (&jsonbContainerOps)
90
- #endif
91
-
92
84
#define JsonFlattenToJsonbDatum (json ) \
93
85
PointerGetDatum(JsonFlatten(json, JsonbEncode, &jsonbContainerOps))
94
86
95
87
#undef JsonbPGetDatum
96
88
#define JsonbPGetDatum (json ) JsonFlattenToJsonbDatum(json)
97
89
98
- #ifndef JsonxPGetDatum
99
- # define JsonxPGetDatum (json ) JsonbPGetDatum(json)
100
- #endif
101
-
102
- #define JsonGetDatum (json ) JsonxPGetDatum(json)
103
-
104
90
#undef DatumGetJsonbP
105
91
#define DatumGetJsonbP (datum ) DatumGetJson(datum, &jsonbContainerOps, NULL)
106
92
#define DatumGetJsontP (datum ) DatumGetJson(datum, &jsontContainerOps, NULL)
107
- #define DatumGetJsonxP (datum ) DatumGetJson(datum, JsonxContainerOps, NULL)
108
- #define DatumGetJsonxTmp (datum ,tmp ) DatumGetJson(datum, JsonxContainerOps, tmp)
109
93
110
94
#undef DatumGetJsonbPCopy
111
95
#define DatumGetJsonbPCopy (datum ) DatumGetJsonbP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
112
96
#define DatumGetJsontPCopy (datum ) DatumGetJsontP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
113
- #define DatumGetJsonxPCopy (datum ) DatumGetJsonxP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
114
97
115
98
#undef PG_RETURN_JSONB_P
116
- #define PG_RETURN_JSONB_P (x ) PG_RETURN_DATUM(JsonGetDatum (x))
99
+ #define PG_RETURN_JSONB_P (x ) PG_RETURN_DATUM(JsonbPGetDatum (x))
117
100
#define PG_RETURN_JSONT_P (x ) PG_RETURN_DATUM(JsontPGetDatum(x))
118
101
119
- #define PG_GETARG_JSONX_TMP (n , tmp ) DatumGetJsonxTmp(PG_GETARG_DATUM(n), tmp)
120
-
121
102
#undef PG_GETARG_JSONB_P
122
- #define PG_GETARG_JSONB_P (n ) PG_GETARG_JSONX_TMP(n , alloca(sizeof(Json))) /* FIXME conditional alloca() */
103
+ #define PG_GETARG_JSONB_P (n ) DatumGetJson(PG_GETARG_DATUM(n), &jsonbContainerOps , alloca(sizeof(Json))) /* FIXME conditional alloca() */
123
104
#define PG_GETARG_JSONT_P (n ) DatumGetJsontP(PG_GETARG_DATUM(n))
124
105
125
106
#define PG_FREE_IF_COPY_JSONB (json , n ) JsonFree(json)
126
107
127
108
#undef PG_GETARG_JSONB_P_COPY
128
- #define PG_GETARG_JSONB_P_COPY (x ) DatumGetJsonxPCopy (PG_GETARG_DATUM(x))
109
+ #define PG_GETARG_JSONB_P_COPY (x ) DatumGetJsonbPCopy (PG_GETARG_DATUM(x))
129
110
130
111
131
112
#define JsonRoot (json ) (&(json)->root)
0 commit comments