1 /*-------------------------------------------------------------------------
4 * Declarations for operations on log sequence numbers (LSNs) of
8 * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
9 * Portions Copyright (c) 1994, Regents of the University of California
11 * src/include/utils/pg_lsn.h
13 *-------------------------------------------------------------------------
19 #include "access/xlogdefs.h"
21 extern Datum pg_lsn_in(PG_FUNCTION_ARGS);
22 extern Datum pg_lsn_out(PG_FUNCTION_ARGS);
23 extern Datum pg_lsn_recv(PG_FUNCTION_ARGS);
24 extern Datum pg_lsn_send(PG_FUNCTION_ARGS);
26 extern Datum pg_lsn_eq(PG_FUNCTION_ARGS);
27 extern Datum pg_lsn_ne(PG_FUNCTION_ARGS);
28 extern Datum pg_lsn_lt(PG_FUNCTION_ARGS);
29 extern Datum pg_lsn_gt(PG_FUNCTION_ARGS);
30 extern Datum pg_lsn_le(PG_FUNCTION_ARGS);
31 extern Datum pg_lsn_ge(PG_FUNCTION_ARGS);
33 extern Datum pg_lsn_mi(PG_FUNCTION_ARGS);
35 #define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X))
36 #define LSNGetDatum(X) (Int64GetDatum((int64) (X)))
38 #define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n))
39 #define PG_RETURN_LSN(x) return LSNGetDatum(x)