diff options
Diffstat (limited to 'src/include/access/xlog_internal.h')
-rw-r--r-- | src/include/access/xlog_internal.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index a3614665e18..cfb7f0a4de6 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.27 2010/01/02 16:58:01 momjian Exp $ + * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.28 2010/01/15 09:19:06 heikki Exp $ */ #ifndef XLOG_INTERNAL_H #define XLOG_INTERNAL_H @@ -151,6 +151,19 @@ typedef XLogLongPageHeaderData *XLogLongPageHeader; } \ } while (0) +/* Align a record pointer to next page */ +#define NextLogPage(recptr) \ + do { \ + if (recptr.xrecoff % XLOG_BLCKSZ != 0) \ + recptr.xrecoff += \ + (XLOG_BLCKSZ - recptr.xrecoff % XLOG_BLCKSZ); \ + if (recptr.xrecoff >= XLogFileSize) \ + { \ + (recptr.xlogid)++; \ + recptr.xrecoff = 0; \ + } \ + } while (0) + /* * Compute ID and segment from an XLogRecPtr. * @@ -253,6 +266,8 @@ extern Datum pg_stop_backup(PG_FUNCTION_ARGS); extern Datum pg_switch_xlog(PG_FUNCTION_ARGS); extern Datum pg_current_xlog_location(PG_FUNCTION_ARGS); extern Datum pg_current_xlog_insert_location(PG_FUNCTION_ARGS); +extern Datum pg_last_xlog_receive_location(PG_FUNCTION_ARGS); +extern Datum pg_last_xlog_replay_location(PG_FUNCTION_ARGS); extern Datum pg_xlogfile_name_offset(PG_FUNCTION_ARGS); extern Datum pg_xlogfile_name(PG_FUNCTION_ARGS); extern Datum pg_is_in_recovery(PG_FUNCTION_ARGS); |