From 7d03a83f4d0736ba869fa6f93973f7623a27038a Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 19 Feb 2014 08:35:23 -0500 Subject: Add a pg_lsn data type, to represent an LSN. Robert Haas and Michael Paquier --- src/include/postgres.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/include/postgres.h') diff --git a/src/include/postgres.h b/src/include/postgres.h index a8a206d988b..e72d5fca2b1 100644 --- a/src/include/postgres.h +++ b/src/include/postgres.h @@ -483,6 +483,20 @@ typedef Datum *DatumPtr; #define ObjectIdGetDatum(X) ((Datum) SET_4_BYTES(X)) +/* + * DatumGetPgLsn + * Returns PostgreSQL log sequence number of a datum. + */ + +#define DatumGetPgLsn(X) ((XLogRecPtr) GET_8_BYTES(X)) + +/* + * PG_LSNGetDatum + * Returns datum representation for a PostgreSQL log sequence number. + */ + +#define PgLsnGetDatum(X) ((Datum) SET_8_BYTES(X)) + /* * DatumGetTransactionId * Returns transaction identifier value of a datum. -- cgit v1.2.3