aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/pg_lsn.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/utils/pg_lsn.h')
-rw-r--r--src/include/utils/pg_lsn.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/utils/pg_lsn.h b/src/include/utils/pg_lsn.h
index dc2193006e5..981fcd6fa8c 100644
--- a/src/include/utils/pg_lsn.h
+++ b/src/include/utils/pg_lsn.h
@@ -16,6 +16,7 @@
#define PG_LSN_H
#include "fmgr.h"
+#include "access/xlogdefs.h"
extern Datum pg_lsn_in(PG_FUNCTION_ARGS);
extern Datum pg_lsn_out(PG_FUNCTION_ARGS);
@@ -31,4 +32,10 @@ extern Datum pg_lsn_ge(PG_FUNCTION_ARGS);
extern Datum pg_lsn_mi(PG_FUNCTION_ARGS);
+#define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X))
+#define LSNGetDatum(X) (Int64GetDatum((int64) (X)))
+
+#define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n))
+#define PG_RETURN_LSN(x) return LSNGetDatum(x)
+
#endif /* PG_LSN_H */