Skip to content

Commit 05a0c83

Browse files
author
Nikita Glukhov
committed
Remove Jsonx macros
1 parent bb319e6 commit 05a0c83

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

src/include/utils/json_generic.h

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -81,51 +81,32 @@ typedef struct Json
8181

8282
#define JsonIsTemporary(json) ((json)->obj.isTemporary)
8383

84-
#ifndef JSONXOID
85-
# define JSONXOID JSONBOID
86-
#endif
87-
88-
#ifndef JsonxContainerOps
89-
# define JsonxContainerOps (&jsonbContainerOps)
90-
#endif
91-
9284
#define JsonFlattenToJsonbDatum(json) \
9385
PointerGetDatum(JsonFlatten(json, JsonbEncode, &jsonbContainerOps))
9486

9587
#undef JsonbPGetDatum
9688
#define JsonbPGetDatum(json) JsonFlattenToJsonbDatum(json)
9789

98-
#ifndef JsonxPGetDatum
99-
# define JsonxPGetDatum(json) JsonbPGetDatum(json)
100-
#endif
101-
102-
#define JsonGetDatum(json) JsonxPGetDatum(json)
103-
10490
#undef DatumGetJsonbP
10591
#define DatumGetJsonbP(datum) DatumGetJson(datum, &jsonbContainerOps, NULL)
10692
#define DatumGetJsontP(datum) DatumGetJson(datum, &jsontContainerOps, NULL)
107-
#define DatumGetJsonxP(datum) DatumGetJson(datum, JsonxContainerOps, NULL)
108-
#define DatumGetJsonxTmp(datum,tmp) DatumGetJson(datum, JsonxContainerOps, tmp)
10993

11094
#undef DatumGetJsonbPCopy
11195
#define DatumGetJsonbPCopy(datum) DatumGetJsonbP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
11296
#define DatumGetJsontPCopy(datum) DatumGetJsontP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
113-
#define DatumGetJsonxPCopy(datum) DatumGetJsonxP(PointerGetDatum(PG_DETOAST_DATUM_COPY(datum)))
11497

11598
#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))
117100
#define PG_RETURN_JSONT_P(x) PG_RETURN_DATUM(JsontPGetDatum(x))
118101

119-
#define PG_GETARG_JSONX_TMP(n, tmp) DatumGetJsonxTmp(PG_GETARG_DATUM(n), tmp)
120-
121102
#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() */
123104
#define PG_GETARG_JSONT_P(n) DatumGetJsontP(PG_GETARG_DATUM(n))
124105

125106
#define PG_FREE_IF_COPY_JSONB(json, n) JsonFree(json)
126107

127108
#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))
129110

130111

131112
#define JsonRoot(json) (&(json)->root)

0 commit comments

Comments
 (0)