summaryrefslogtreecommitdiff
path: root/src/include/utils/jsonb.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-09-12 19:57:07 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-09-12 19:57:07 +0200
commite8d78581bb864369035c736a82ecfb57482a1a09 (patch)
treeb6881a0046c905ad671e0b43d60a42a119f4a3d4 /src/include/utils/jsonb.h
parent595836e99bf1ee6d43405b885fb69bb8c6d3ee23 (diff)
downloadpostgresql-e8d78581bb864369035c736a82ecfb57482a1a09.tar.gz
Revert "Convert *GetDatum() and DatumGet*() macros to inline functions"
This reverts commit 595836e99bf1ee6d43405b885fb69bb8c6d3ee23. It has problems when USE_FLOAT8_BYVAL is off.
Diffstat (limited to 'src/include/utils/jsonb.h')
-rw-r--r--src/include/utils/jsonb.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/include/utils/jsonb.h b/src/include/utils/jsonb.h
index bdd1c9c75d..4cbe6edf21 100644
--- a/src/include/utils/jsonb.h
+++ b/src/include/utils/jsonb.h
@@ -67,6 +67,14 @@ typedef enum
#define JGINFLAG_HASHED 0x10 /* OR'd into flag if value was hashed */
#define JGIN_MAXLENGTH 125 /* max length of text part before hashing */
+/* Convenience macros */
+#define DatumGetJsonbP(d) ((Jsonb *) PG_DETOAST_DATUM(d))
+#define DatumGetJsonbPCopy(d) ((Jsonb *) PG_DETOAST_DATUM_COPY(d))
+#define JsonbPGetDatum(p) PointerGetDatum(p)
+#define PG_GETARG_JSONB_P(x) DatumGetJsonbP(PG_GETARG_DATUM(x))
+#define PG_GETARG_JSONB_P_COPY(x) DatumGetJsonbPCopy(PG_GETARG_DATUM(x))
+#define PG_RETURN_JSONB_P(x) PG_RETURN_POINTER(x)
+
typedef struct JsonbPair JsonbPair;
typedef struct JsonbValue JsonbValue;
@@ -367,29 +375,6 @@ typedef struct JsonbIterator
} JsonbIterator;
-/* Convenience macros */
-static inline Jsonb *
-DatumGetJsonbP(Datum d)
-{
- return (Jsonb *) PG_DETOAST_DATUM(d);
-}
-
-static inline Jsonb *
-DatumGetJsonbPCopy(Datum d)
-{
- return (Jsonb *) PG_DETOAST_DATUM_COPY(d);
-}
-
-static inline Datum
-JsonbPGetDatum(const Jsonb *p)
-{
- return PointerGetDatum(p);
-}
-
-#define PG_GETARG_JSONB_P(x) DatumGetJsonbP(PG_GETARG_DATUM(x))
-#define PG_GETARG_JSONB_P_COPY(x) DatumGetJsonbPCopy(PG_GETARG_DATUM(x))
-#define PG_RETURN_JSONB_P(x) PG_RETURN_POINTER(x)
-
/* Support functions */
extern uint32 getJsonbOffset(const JsonbContainer *jc, int index);
extern uint32 getJsonbLength(const JsonbContainer *jc, int index);