aboutsummaryrefslogtreecommitdiff
path: root/src/include/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/access')
-rw-r--r--src/include/access/htup.h7
-rw-r--r--src/include/access/xact.h34
-rw-r--r--src/include/access/xlog.h12
3 files changed, 49 insertions, 4 deletions
diff --git a/src/include/access/htup.h b/src/include/access/htup.h
index f105dafee27..6f2b085b5c7 100644
--- a/src/include/access/htup.h
+++ b/src/include/access/htup.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: htup.h,v 1.35 2000/09/07 09:58:35 vadim Exp $
+ * $Id: htup.h,v 1.36 2000/10/20 11:01:14 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -95,7 +95,7 @@ typedef struct xl_heap_delete
xl_heaptid target; /* deleted tuple id */
} xl_heap_delete;
-#define SizeOfHeapDelete (offsetof(xl_heaptid, tid) + SizeOfIptrData))
+#define SizeOfHeapDelete (offsetof(xl_heaptid, tid) + SizeOfIptrData)
/* This is what we need to know about insert - 26 + data */
typedef struct xl_heap_insert
@@ -111,12 +111,13 @@ typedef struct xl_heap_insert
#define SizeOfHeapInsert (offsetof(xl_heap_insert, mask) + sizeof(uint8))
-/* This is what we need to know about update - 28 + data */
+/* This is what we need to know about update - 32 + data */
typedef struct xl_heap_update
{
xl_heaptid target; /* deleted tuple id */
ItemPointerData newtid; /* new inserted tuple id */
/* something from header of new tuple version */
+ Oid t_oid;
int16 t_natts;
uint8 t_hoff;
uint8 mask; /* low 8 bits of t_infomask */
diff --git a/src/include/access/xact.h b/src/include/access/xact.h
index c512a4a66f9..712e88b6005 100644
--- a/src/include/access/xact.h
+++ b/src/include/access/xact.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: xact.h,v 1.27 2000/07/28 01:04:40 tgl Exp $
+ * $Id: xact.h,v 1.28 2000/10/20 11:01:14 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -78,6 +78,35 @@ typedef TransactionStateData *TransactionState;
(*((TransactionId*) (dest)) = NullTransactionId)
+#ifdef XLOG
+
+/*
+ * XLOG allows to store some information in high 4 bits of log
+ * record xl_info field
+ */
+#define XLOG_XACT_COMMIT 0x00
+#define XLOG_XACT_ABORT 0x20
+
+typedef struct xl_xact_commit
+{
+ time_t xtime;
+ /*
+ * Array of RelFileNode-s to drop may follow
+ * at the end of struct
+ */
+} xl_xact_commit;
+
+#define SizeOfXactCommit ((offsetof(xl_xact_commit, xtime) + sizeof(time_t)))
+
+typedef struct xl_xact_abort
+{
+ time_t xtime;
+} xl_xact_abort;
+
+#define SizeOfXactAbort ((offsetof(xl_xact_abort, xtime) + sizeof(time_t)))
+
+#endif
+
/* ----------------
* extern definitions
* ----------------
@@ -108,6 +137,9 @@ extern void AbortOutOfAnyTransaction(void);
extern TransactionId DisabledTransactionId;
+extern void XactPushRollback(void (*func) (void *), void* data);
+extern void XactPopRollback(void);
+
/* defined in xid.c */
extern Datum xidin(PG_FUNCTION_ARGS);
extern Datum xidout(PG_FUNCTION_ARGS);
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index 69bf1487777..c73217f9ccc 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -72,12 +72,24 @@ typedef XLogPageHeaderData *XLogPageHeader;
#define XLP_FIRST_IS_SUBRECORD 0x0001
+#define XLByteLT(left, right) \
+ (right.xlogid > left.xlogid || \
+ (right.xlogid == left.xlogid && right.xrecoff > left.xrecoff))
+
+#define XLByteLE(left, right) \
+ (right.xlogid > left.xlogid || \
+ (right.xlogid == left.xlogid && right.xrecoff >= left.xrecoff))
+
+#define XLByteEQ(left, right) \
+ (right.xlogid == left.xlogid && right.xrecoff == left.xrecoff)
+
/*
* StartUpID (SUI) - system startups counter.
* It's to allow removing pg_log after shutdown.
*/
typedef uint32 StartUpID;
extern StartUpID ThisStartUpID;
+extern bool InRecovery;
extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info,
char *hdr, uint32 hdrlen,