1 /*------------------------------------------------------------------------- 2 * 3 * pg_lsn.h 4 * Declarations for operations on log sequence numbers (LSNs) of 5 * PostgreSQL. 6 * 7 * 8 * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group 9 * Portions Copyright (c) 1994, Regents of the University of California 10 * 11 * src/include/utils/pg_lsn.h 12 * 13 *------------------------------------------------------------------------- 14 */ 15 #ifndef PG_LSN_H 16 #define PG_LSN_H 17 18 #include "fmgr.h" 19 #include "access/xlogdefs.h" 20 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); 25 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); 32 extern Datum pg_lsn_cmp(PG_FUNCTION_ARGS); 33 extern Datum pg_lsn_hash(PG_FUNCTION_ARGS); 34 35 extern Datum pg_lsn_mi(PG_FUNCTION_ARGS); 36 37 #define DatumGetLSN(X) ((XLogRecPtr) DatumGetInt64(X)) 38 #define LSNGetDatum(X) (Int64GetDatum((int64) (X))) 39 40 #define PG_GETARG_LSN(n) DatumGetLSN(PG_GETARG_DATUM(n)) 41 #define PG_RETURN_LSN(x) return LSNGetDatum(x) 42 43 #endif /* PG_LSN_H */ 44