aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/storage/itemptr.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/storage/itemptr.h b/src/include/storage/itemptr.h
index 354e50e68be..fafefa14cd8 100644
--- a/src/include/storage/itemptr.h
+++ b/src/include/storage/itemptr.h
@@ -222,4 +222,24 @@ extern int32 ItemPointerCompare(ItemPointer arg1, ItemPointer arg2);
extern void ItemPointerInc(ItemPointer pointer);
extern void ItemPointerDec(ItemPointer pointer);
+/* ----------------
+ * Datum conversion functions
+ * ----------------
+ */
+
+static inline ItemPointer
+DatumGetItemPointer(Datum X)
+{
+ return (ItemPointer) DatumGetPointer(X);
+}
+
+static inline Datum
+ItemPointerGetDatum(const ItemPointerData *X)
+{
+ return PointerGetDatum(X);
+}
+
+#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n))
+#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x)
+
#endif /* ITEMPTR_H */