summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorVadim B. Mikheev2000-07-03 02:54:21 +0000
committerVadim B. Mikheev2000-07-03 02:54:21 +0000
commit1b67fe17b89380d2ffb74e850e7b38737bde6c76 (patch)
treea126e8183aa9737332372808b25220a95490a4f4 /src/include
parent80c646958a14ed343a686566cb77bd92961cf589 (diff)
heap' logging
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/hio.h4
-rw-r--r--src/include/access/htup.h13
-rw-r--r--src/include/access/xlog.h7
-rw-r--r--src/include/storage/bufpage.h6
4 files changed, 21 insertions, 9 deletions
diff --git a/src/include/access/hio.h b/src/include/access/hio.h
index 999d2412e76..c0636a4ff34 100644
--- a/src/include/access/hio.h
+++ b/src/include/access/hio.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: hio.h,v 1.14 2000/01/26 05:57:50 momjian Exp $
+ * $Id: hio.h,v 1.15 2000/07/03 02:54:17 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,6 @@
extern void RelationPutHeapTuple(Relation relation, Buffer buffer,
HeapTuple tuple);
-extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
+extern Buffer RelationGetBufferForTuple(Relation relation, Size len, Buffer Ubuf);
#endif /* HIO_H */
diff --git a/src/include/access/htup.h b/src/include/access/htup.h
index 3370960e2fd..4665fe60bb7 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.31 2000/07/02 22:01:00 momjian Exp $
+ * $Id: htup.h,v 1.32 2000/07/03 02:54:17 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -69,22 +69,25 @@ typedef HeapTupleHeaderData *HeapTupleHeader;
#define XLOG_HEAP_MOVE 0x30
/*
- * All what we need to find changed tuple (14 bytes)
+ * All what we need to find changed tuple (18 bytes)
*/
typedef struct xl_heaptid
{
Oid dbId; /* database */
Oid relId; /* relation */
+ CommandId cid; /* this is for "better" tuple' */
+ /* identification - it allows to avoid */
+ /* "compensation" records for undo */
ItemPointerData tid; /* changed tuple id */
} xl_heaptid;
-/* This is what we need to know about delete - ALIGN(14) = 16 bytes */
+/* This is what we need to know about delete - ALIGN(18) = 24 bytes */
typedef struct xl_heap_delete
{
xl_heaptid dtid; /* deleted tuple id */
} xl_heap_delete;
-/* This is what we need to know about insert - 22 + data */
+/* This is what we need to know about insert - 26 + data */
typedef struct xl_heap_insert
{
xl_heaptid itid; /* inserted tuple id */
@@ -108,7 +111,7 @@ typedef struct xl_heap_update
/* NEW TUPLE DATA FOLLOWS AT END OF STRUCT */
} xl_heap_update;
-/* This is what we need to know about tuple move - ALIGN(20) = 24 bytes */
+/* This is what we need to know about tuple move - 24 bytes */
typedef struct xl_heap_move
{
xl_heaptid ftid; /* moved from */
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index b5fda0b58ad..b86339f072f 100644
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -68,6 +68,13 @@ typedef XLogPageHeaderData *XLogPageHeader;
#define XLP_FIRST_IS_SUBRECORD 0x0001
+/*
+ * StartUpID (SUI) - system startups counter.
+ * It's to allow removing pg_log after shutdown.
+ */
+typedef uint32 StartUpID;
+extern StartUpID ThisStartUpID;
+
extern XLogRecPtr XLogInsert(RmgrId rmid, uint8 info,
char *hdr, uint32 hdrlen,
char *buf, uint32 buflen);
diff --git a/src/include/storage/bufpage.h b/src/include/storage/bufpage.h
index 15d1106f26c..30b5a93ad64 100644
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: bufpage.h,v 1.29 2000/06/02 10:20:27 vadim Exp $
+ * $Id: bufpage.h,v 1.30 2000/07/03 02:54:21 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,8 +118,10 @@ typedef OpaqueData *Opaque;
typedef struct PageHeaderData
{
#ifdef XLOG
- XLogRecPtr pd_lsn; /* XLOG: next byte after last byte of xlog */
+ XLogRecPtr pd_lsn; /* LSN: next byte after last byte of xlog */
/* record for last change of this page */
+ StartUpID pd_sui; /* SUI of last changes (currently it's */
+ /* used by heap AM only) */
#endif
LocationIndex pd_lower; /* offset to start of free space */
LocationIndex pd_upper; /* offset to end of free space */