* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.117 2005/05/17 03:34:18 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.118 2005/06/06 17:01:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "gist_redo: unimplemented");
}
-void
-gist_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- elog(PANIC, "gist_undo: unimplemented");
-}
-
void
gist_desc(char *buf, uint8 xl_info, char *rec)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.79 2005/05/11 06:24:51 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.80 2005/06/06 17:01:21 tgl Exp $
*
* NOTES
* This file contains only the public interface routines.
elog(PANIC, "hash_redo: unimplemented");
}
-void
-hash_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- elog(PANIC, "hash_undo: unimplemented");
-}
-
void
hash_desc(char *buf, uint8 xl_info, char *rec)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.191 2005/05/19 21:35:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.192 2005/06/06 17:01:22 tgl Exp $
*
*
* INTERFACE ROUTINES
}
static void
-heap_xlog_clean(bool redo, XLogRecPtr lsn, XLogRecord *record)
+heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record)
{
xl_heap_clean *xlrec = (xl_heap_clean *) XLogRecGetData(record);
Relation reln;
Buffer buffer;
Page page;
- if (!redo || (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
- reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
}
static void
-heap_xlog_newpage(bool redo, XLogRecPtr lsn, XLogRecord *record)
+heap_xlog_newpage(XLogRecPtr lsn, XLogRecord *record)
{
xl_heap_newpage *xlrec = (xl_heap_newpage *) XLogRecGetData(record);
Relation reln;
* do not do anything that assumes we are touching a heap.
*/
- if (!redo || (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
- reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
buffer = XLogReadBuffer(true, reln, xlrec->blkno);
}
static void
-heap_xlog_delete(bool redo, XLogRecPtr lsn, XLogRecord *record)
+heap_xlog_delete(XLogRecPtr lsn, XLogRecord *record)
{
xl_heap_delete *xlrec = (xl_heap_delete *) XLogRecGetData(record);
Relation reln;
ItemId lp = NULL;
HeapTupleHeader htup;
- if (redo && (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
- reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer))
- elog(PANIC, "heap_delete_%sdo: no block", (redo) ? "re" : "un");
+ elog(PANIC, "heap_delete_redo: no block");
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page))
- elog(PANIC, "heap_delete_%sdo: uninitialized page", (redo) ? "re" : "un");
+ elog(PANIC, "heap_delete_redo: uninitialized page");
- if (redo)
+ if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
{
- if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- return;
- }
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ ReleaseBuffer(buffer);
+ return;
}
- else if (XLByteLT(PageGetLSN(page), lsn)) /* changes are not applied
- * ?! */
- elog(PANIC, "heap_delete_undo: bad page LSN");
offnum = ItemPointerGetOffsetNumber(&(xlrec->target.tid));
if (PageGetMaxOffsetNumber(page) >= offnum)
lp = PageGetItemId(page, offnum);
if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsUsed(lp))
- elog(PANIC, "heap_delete_%sdo: invalid lp", (redo) ? "re" : "un");
+ elog(PANIC, "heap_delete_redo: invalid lp");
htup = (HeapTupleHeader) PageGetItem(page, lp);
- if (redo)
- {
- htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
- HEAP_XMAX_INVALID |
- HEAP_XMAX_IS_MULTI |
- HEAP_IS_LOCKED |
- HEAP_MOVED);
- HeapTupleHeaderSetXmax(htup, record->xl_xid);
- HeapTupleHeaderSetCmax(htup, FirstCommandId);
- /* Make sure there is no forward chain link in t_ctid */
- htup->t_ctid = xlrec->target.tid;
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- return;
- }
-
- elog(PANIC, "heap_delete_undo: unimplemented");
+ htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
+ HEAP_XMAX_INVALID |
+ HEAP_XMAX_IS_MULTI |
+ HEAP_IS_LOCKED |
+ HEAP_MOVED);
+ HeapTupleHeaderSetXmax(htup, record->xl_xid);
+ HeapTupleHeaderSetCmax(htup, FirstCommandId);
+ /* Make sure there is no forward chain link in t_ctid */
+ htup->t_ctid = xlrec->target.tid;
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
}
static void
-heap_xlog_insert(bool redo, XLogRecPtr lsn, XLogRecord *record)
+heap_xlog_insert(XLogRecPtr lsn, XLogRecord *record)
{
xl_heap_insert *xlrec = (xl_heap_insert *) XLogRecGetData(record);
Relation reln;
Buffer buffer;
Page page;
OffsetNumber offnum;
+ struct
+ {
+ HeapTupleHeaderData hdr;
+ char data[MaxTupleSize];
+ } tbuf;
+ HeapTupleHeader htup;
+ xl_heap_header xlhdr;
+ uint32 newlen;
- if (redo && (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
- reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
- buffer = XLogReadBuffer((redo) ? true : false, reln,
+ buffer = XLogReadBuffer(true, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer))
return;
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page) &&
- (!redo || !(record->xl_info & XLOG_HEAP_INIT_PAGE)))
- elog(PANIC, "heap_insert_%sdo: uninitialized page", (redo) ? "re" : "un");
+ !(record->xl_info & XLOG_HEAP_INIT_PAGE))
+ elog(PANIC, "heap_insert_redo: uninitialized page");
- if (redo)
- {
- struct
- {
- HeapTupleHeaderData hdr;
- char data[MaxTupleSize];
- } tbuf;
- HeapTupleHeader htup;
- xl_heap_header xlhdr;
- uint32 newlen;
-
- if (record->xl_info & XLOG_HEAP_INIT_PAGE)
- PageInit(page, BufferGetPageSize(buffer), 0);
-
- if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- return;
- }
-
- offnum = ItemPointerGetOffsetNumber(&(xlrec->target.tid));
- if (PageGetMaxOffsetNumber(page) + 1 < offnum)
- elog(PANIC, "heap_insert_redo: invalid max offset number");
-
- newlen = record->xl_len - SizeOfHeapInsert - SizeOfHeapHeader;
- Assert(newlen <= MaxTupleSize);
- memcpy((char *) &xlhdr,
- (char *) xlrec + SizeOfHeapInsert,
- SizeOfHeapHeader);
- htup = &tbuf.hdr;
- MemSet((char *) htup, 0, sizeof(HeapTupleHeaderData));
- /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
- memcpy((char *) htup + offsetof(HeapTupleHeaderData, t_bits),
- (char *) xlrec + SizeOfHeapInsert + SizeOfHeapHeader,
- newlen);
- newlen += offsetof(HeapTupleHeaderData, t_bits);
- htup->t_natts = xlhdr.t_natts;
- htup->t_infomask = xlhdr.t_infomask;
- htup->t_hoff = xlhdr.t_hoff;
- HeapTupleHeaderSetXmin(htup, record->xl_xid);
- HeapTupleHeaderSetCmin(htup, FirstCommandId);
- htup->t_ctid = xlrec->target.tid;
+ if (record->xl_info & XLOG_HEAP_INIT_PAGE)
+ PageInit(page, BufferGetPageSize(buffer), 0);
- offnum = PageAddItem(page, (Item) htup, newlen, offnum,
- LP_USED | OverwritePageMode);
- if (offnum == InvalidOffsetNumber)
- elog(PANIC, "heap_insert_redo: failed to add tuple");
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
+ if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
+ {
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
+ ReleaseBuffer(buffer);
return;
}
- /* undo insert */
- if (XLByteLT(PageGetLSN(page), lsn)) /* changes are not applied
- * ?! */
- elog(PANIC, "heap_insert_undo: bad page LSN");
-
- elog(PANIC, "heap_insert_undo: unimplemented");
+ offnum = ItemPointerGetOffsetNumber(&(xlrec->target.tid));
+ if (PageGetMaxOffsetNumber(page) + 1 < offnum)
+ elog(PANIC, "heap_insert_redo: invalid max offset number");
+
+ newlen = record->xl_len - SizeOfHeapInsert - SizeOfHeapHeader;
+ Assert(newlen <= MaxTupleSize);
+ memcpy((char *) &xlhdr,
+ (char *) xlrec + SizeOfHeapInsert,
+ SizeOfHeapHeader);
+ htup = &tbuf.hdr;
+ MemSet((char *) htup, 0, sizeof(HeapTupleHeaderData));
+ /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
+ memcpy((char *) htup + offsetof(HeapTupleHeaderData, t_bits),
+ (char *) xlrec + SizeOfHeapInsert + SizeOfHeapHeader,
+ newlen);
+ newlen += offsetof(HeapTupleHeaderData, t_bits);
+ htup->t_natts = xlhdr.t_natts;
+ htup->t_infomask = xlhdr.t_infomask;
+ htup->t_hoff = xlhdr.t_hoff;
+ HeapTupleHeaderSetXmin(htup, record->xl_xid);
+ HeapTupleHeaderSetCmin(htup, FirstCommandId);
+ htup->t_ctid = xlrec->target.tid;
+
+ offnum = PageAddItem(page, (Item) htup, newlen, offnum,
+ LP_USED | OverwritePageMode);
+ if (offnum == InvalidOffsetNumber)
+ elog(PANIC, "heap_insert_redo: failed to add tuple");
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
}
/*
* Handles UPDATE & MOVE
*/
static void
-heap_xlog_update(bool redo, XLogRecPtr lsn, XLogRecord *record, bool move)
+heap_xlog_update(XLogRecPtr lsn, XLogRecord *record, bool move)
{
xl_heap_update *xlrec = (xl_heap_update *) XLogRecGetData(record);
- Relation reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->target.node);
+ Relation reln = XLogOpenRelation(xlrec->target.node);
Buffer buffer;
bool samepage =
(ItemPointerGetBlockNumber(&(xlrec->newtid)) ==
OffsetNumber offnum;
ItemId lp = NULL;
HeapTupleHeader htup;
+ struct
+ {
+ HeapTupleHeaderData hdr;
+ char data[MaxTupleSize];
+ } tbuf;
+ xl_heap_header xlhdr;
+ int hsize;
+ uint32 newlen;
if (!RelationIsValid(reln))
return;
- if (redo && (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
goto newt;
/* Deal with old tuple version */
buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer))
- elog(PANIC, "heap_update_%sdo: no block", (redo) ? "re" : "un");
+ elog(PANIC, "heap_update_redo: no block");
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page))
- elog(PANIC, "heap_update_%sdo: uninitialized old page", (redo) ? "re" : "un");
+ elog(PANIC, "heap_update_redo: uninitialized old page");
- if (redo)
+ if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
{
- if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- if (samepage)
- return;
- goto newt;
- }
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ ReleaseBuffer(buffer);
+ if (samepage)
+ return;
+ goto newt;
}
- else if (XLByteLT(PageGetLSN(page), lsn)) /* changes are not applied
- * ?! */
- elog(PANIC, "heap_update_undo: bad old tuple page LSN");
offnum = ItemPointerGetOffsetNumber(&(xlrec->target.tid));
if (PageGetMaxOffsetNumber(page) >= offnum)
lp = PageGetItemId(page, offnum);
if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsUsed(lp))
- elog(PANIC, "heap_update_%sdo: invalid lp", (redo) ? "re" : "un");
+ elog(PANIC, "heap_update_redo: invalid lp");
htup = (HeapTupleHeader) PageGetItem(page, lp);
- if (redo)
+ if (move)
{
- if (move)
- {
- htup->t_infomask &= ~(HEAP_XMIN_COMMITTED |
- HEAP_XMIN_INVALID |
- HEAP_MOVED_IN);
- htup->t_infomask |= HEAP_MOVED_OFF;
- HeapTupleHeaderSetXvac(htup, record->xl_xid);
- /* Make sure there is no forward chain link in t_ctid */
- htup->t_ctid = xlrec->target.tid;
- }
- else
- {
- htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
- HEAP_XMAX_INVALID |
- HEAP_XMAX_IS_MULTI |
- HEAP_IS_LOCKED |
- HEAP_MOVED);
- HeapTupleHeaderSetXmax(htup, record->xl_xid);
- HeapTupleHeaderSetCmax(htup, FirstCommandId);
- /* Set forward chain link in t_ctid */
- htup->t_ctid = xlrec->newtid;
- }
- if (samepage)
- goto newsame;
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- goto newt;
+ htup->t_infomask &= ~(HEAP_XMIN_COMMITTED |
+ HEAP_XMIN_INVALID |
+ HEAP_MOVED_IN);
+ htup->t_infomask |= HEAP_MOVED_OFF;
+ HeapTupleHeaderSetXvac(htup, record->xl_xid);
+ /* Make sure there is no forward chain link in t_ctid */
+ htup->t_ctid = xlrec->target.tid;
}
-
- elog(PANIC, "heap_update_undo: unimplemented");
+ else
+ {
+ htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
+ HEAP_XMAX_INVALID |
+ HEAP_XMAX_IS_MULTI |
+ HEAP_IS_LOCKED |
+ HEAP_MOVED);
+ HeapTupleHeaderSetXmax(htup, record->xl_xid);
+ HeapTupleHeaderSetCmax(htup, FirstCommandId);
+ /* Set forward chain link in t_ctid */
+ htup->t_ctid = xlrec->newtid;
+ }
+ if (samepage)
+ goto newsame;
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
/* Deal with new tuple */
newt:;
- if (redo &&
- ((record->xl_info & XLR_BKP_BLOCK_2) ||
- ((record->xl_info & XLR_BKP_BLOCK_1) && samepage)))
+ if ((record->xl_info & XLR_BKP_BLOCK_2) ||
+ ((record->xl_info & XLR_BKP_BLOCK_1) && samepage))
return;
- buffer = XLogReadBuffer((redo) ? true : false, reln,
+ buffer = XLogReadBuffer(true, reln,
ItemPointerGetBlockNumber(&(xlrec->newtid)));
if (!BufferIsValid(buffer))
return;
newsame:;
if (PageIsNew((PageHeader) page) &&
- (!redo || !(record->xl_info & XLOG_HEAP_INIT_PAGE)))
- elog(PANIC, "heap_update_%sdo: uninitialized page", (redo) ? "re" : "un");
+ !(record->xl_info & XLOG_HEAP_INIT_PAGE))
+ elog(PANIC, "heap_update_redo: uninitialized page");
- if (redo)
- {
- struct
- {
- HeapTupleHeaderData hdr;
- char data[MaxTupleSize];
- } tbuf;
- xl_heap_header xlhdr;
- int hsize;
- uint32 newlen;
-
- if (record->xl_info & XLOG_HEAP_INIT_PAGE)
- PageInit(page, BufferGetPageSize(buffer), 0);
-
- if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- return;
- }
-
- offnum = ItemPointerGetOffsetNumber(&(xlrec->newtid));
- if (PageGetMaxOffsetNumber(page) + 1 < offnum)
- elog(PANIC, "heap_update_redo: invalid max offset number");
-
- hsize = SizeOfHeapUpdate + SizeOfHeapHeader;
- if (move)
- hsize += (2 * sizeof(TransactionId));
-
- newlen = record->xl_len - hsize;
- Assert(newlen <= MaxTupleSize);
- memcpy((char *) &xlhdr,
- (char *) xlrec + SizeOfHeapUpdate,
- SizeOfHeapHeader);
- htup = &tbuf.hdr;
- MemSet((char *) htup, 0, sizeof(HeapTupleHeaderData));
- /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
- memcpy((char *) htup + offsetof(HeapTupleHeaderData, t_bits),
- (char *) xlrec + hsize,
- newlen);
- newlen += offsetof(HeapTupleHeaderData, t_bits);
- htup->t_natts = xlhdr.t_natts;
- htup->t_infomask = xlhdr.t_infomask;
- htup->t_hoff = xlhdr.t_hoff;
-
- if (move)
- {
- TransactionId xid[2]; /* xmax, xmin */
-
- memcpy((char *) xid,
- (char *) xlrec + SizeOfHeapUpdate + SizeOfHeapHeader,
- 2 * sizeof(TransactionId));
- HeapTupleHeaderSetXmin(htup, xid[1]);
- HeapTupleHeaderSetXmax(htup, xid[0]);
- HeapTupleHeaderSetXvac(htup, record->xl_xid);
- }
- else
- {
- HeapTupleHeaderSetXmin(htup, record->xl_xid);
- HeapTupleHeaderSetCmin(htup, FirstCommandId);
- }
- /* Make sure there is no forward chain link in t_ctid */
- htup->t_ctid = xlrec->newtid;
+ if (record->xl_info & XLOG_HEAP_INIT_PAGE)
+ PageInit(page, BufferGetPageSize(buffer), 0);
- offnum = PageAddItem(page, (Item) htup, newlen, offnum,
- LP_USED | OverwritePageMode);
- if (offnum == InvalidOffsetNumber)
- elog(PANIC, "heap_update_redo: failed to add tuple");
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
+ if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
+ {
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
+ ReleaseBuffer(buffer);
return;
}
- /* undo */
- if (XLByteLT(PageGetLSN(page), lsn)) /* changes not applied?! */
- elog(PANIC, "heap_update_undo: bad new tuple page LSN");
-
- elog(PANIC, "heap_update_undo: unimplemented");
+ offnum = ItemPointerGetOffsetNumber(&(xlrec->newtid));
+ if (PageGetMaxOffsetNumber(page) + 1 < offnum)
+ elog(PANIC, "heap_update_redo: invalid max offset number");
+
+ hsize = SizeOfHeapUpdate + SizeOfHeapHeader;
+ if (move)
+ hsize += (2 * sizeof(TransactionId));
+
+ newlen = record->xl_len - hsize;
+ Assert(newlen <= MaxTupleSize);
+ memcpy((char *) &xlhdr,
+ (char *) xlrec + SizeOfHeapUpdate,
+ SizeOfHeapHeader);
+ htup = &tbuf.hdr;
+ MemSet((char *) htup, 0, sizeof(HeapTupleHeaderData));
+ /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
+ memcpy((char *) htup + offsetof(HeapTupleHeaderData, t_bits),
+ (char *) xlrec + hsize,
+ newlen);
+ newlen += offsetof(HeapTupleHeaderData, t_bits);
+ htup->t_natts = xlhdr.t_natts;
+ htup->t_infomask = xlhdr.t_infomask;
+ htup->t_hoff = xlhdr.t_hoff;
+
+ if (move)
+ {
+ TransactionId xid[2]; /* xmax, xmin */
+
+ memcpy((char *) xid,
+ (char *) xlrec + SizeOfHeapUpdate + SizeOfHeapHeader,
+ 2 * sizeof(TransactionId));
+ HeapTupleHeaderSetXmin(htup, xid[1]);
+ HeapTupleHeaderSetXmax(htup, xid[0]);
+ HeapTupleHeaderSetXvac(htup, record->xl_xid);
+ }
+ else
+ {
+ HeapTupleHeaderSetXmin(htup, record->xl_xid);
+ HeapTupleHeaderSetCmin(htup, FirstCommandId);
+ }
+ /* Make sure there is no forward chain link in t_ctid */
+ htup->t_ctid = xlrec->newtid;
+ offnum = PageAddItem(page, (Item) htup, newlen, offnum,
+ LP_USED | OverwritePageMode);
+ if (offnum == InvalidOffsetNumber)
+ elog(PANIC, "heap_update_redo: failed to add tuple");
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
}
static void
-heap_xlog_lock(bool redo, XLogRecPtr lsn, XLogRecord *record)
+heap_xlog_lock(XLogRecPtr lsn, XLogRecord *record)
{
xl_heap_lock *xlrec = (xl_heap_lock *) XLogRecGetData(record);
Relation reln;
ItemId lp = NULL;
HeapTupleHeader htup;
- if (redo && (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
- reln = XLogOpenRelation(redo, RM_HEAP_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer))
- elog(PANIC, "heap_lock_%sdo: no block", (redo) ? "re" : "un");
+ elog(PANIC, "heap_lock_redo: no block");
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page))
- elog(PANIC, "heap_lock_%sdo: uninitialized page", (redo) ? "re" : "un");
+ elog(PANIC, "heap_lock_redo: uninitialized page");
- if (redo)
+ if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
{
- if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- return;
- }
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ ReleaseBuffer(buffer);
+ return;
}
- else if (XLByteLT(PageGetLSN(page), lsn)) /* changes are not applied
- * ?! */
- elog(PANIC, "heap_lock_undo: bad page LSN");
offnum = ItemPointerGetOffsetNumber(&(xlrec->target.tid));
if (PageGetMaxOffsetNumber(page) >= offnum)
lp = PageGetItemId(page, offnum);
if (PageGetMaxOffsetNumber(page) < offnum || !ItemIdIsUsed(lp))
- elog(PANIC, "heap_lock_%sdo: invalid lp", (redo) ? "re" : "un");
+ elog(PANIC, "heap_lock_redo: invalid lp");
htup = (HeapTupleHeader) PageGetItem(page, lp);
- if (redo)
- {
- /*
- * Presently, we don't bother to restore the locked state, but
- * just set the XMAX_INVALID bit.
- */
- htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
- HEAP_XMAX_INVALID |
- HEAP_XMAX_IS_MULTI |
- HEAP_IS_LOCKED |
- HEAP_MOVED);
- htup->t_infomask |= HEAP_XMAX_INVALID;
- HeapTupleHeaderSetXmax(htup, record->xl_xid);
- HeapTupleHeaderSetCmax(htup, FirstCommandId);
- /* Make sure there is no forward chain link in t_ctid */
- htup->t_ctid = xlrec->target.tid;
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- return;
- }
-
- elog(PANIC, "heap_lock_undo: unimplemented");
+ /*
+ * Presently, we don't bother to restore the locked state, but
+ * just set the XMAX_INVALID bit.
+ */
+ htup->t_infomask &= ~(HEAP_XMAX_COMMITTED |
+ HEAP_XMAX_INVALID |
+ HEAP_XMAX_IS_MULTI |
+ HEAP_IS_LOCKED |
+ HEAP_MOVED);
+ htup->t_infomask |= HEAP_XMAX_INVALID;
+ HeapTupleHeaderSetXmax(htup, record->xl_xid);
+ HeapTupleHeaderSetCmax(htup, FirstCommandId);
+ /* Make sure there is no forward chain link in t_ctid */
+ htup->t_ctid = xlrec->target.tid;
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
}
void
info &= XLOG_HEAP_OPMASK;
if (info == XLOG_HEAP_INSERT)
- heap_xlog_insert(true, lsn, record);
+ heap_xlog_insert(lsn, record);
else if (info == XLOG_HEAP_DELETE)
- heap_xlog_delete(true, lsn, record);
+ heap_xlog_delete(lsn, record);
else if (info == XLOG_HEAP_UPDATE)
- heap_xlog_update(true, lsn, record, false);
+ heap_xlog_update(lsn, record, false);
else if (info == XLOG_HEAP_MOVE)
- heap_xlog_update(true, lsn, record, true);
+ heap_xlog_update(lsn, record, true);
else if (info == XLOG_HEAP_CLEAN)
- heap_xlog_clean(true, lsn, record);
+ heap_xlog_clean(lsn, record);
else if (info == XLOG_HEAP_NEWPAGE)
- heap_xlog_newpage(true, lsn, record);
+ heap_xlog_newpage(lsn, record);
else if (info == XLOG_HEAP_LOCK)
- heap_xlog_lock(true, lsn, record);
+ heap_xlog_lock(lsn, record);
else
elog(PANIC, "heap_redo: unknown op code %u", info);
}
-void
-heap_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- uint8 info = record->xl_info & ~XLR_INFO_MASK;
-
- info &= XLOG_HEAP_OPMASK;
- if (info == XLOG_HEAP_INSERT)
- heap_xlog_insert(false, lsn, record);
- else if (info == XLOG_HEAP_DELETE)
- heap_xlog_delete(false, lsn, record);
- else if (info == XLOG_HEAP_UPDATE)
- heap_xlog_update(false, lsn, record, false);
- else if (info == XLOG_HEAP_MOVE)
- heap_xlog_update(false, lsn, record, true);
- else if (info == XLOG_HEAP_CLEAN)
- heap_xlog_clean(false, lsn, record);
- else if (info == XLOG_HEAP_NEWPAGE)
- heap_xlog_newpage(false, lsn, record);
- else if (info == XLOG_HEAP_LOCK)
- heap_xlog_lock(false, lsn, record);
- else
- elog(PANIC, "heap_undo: unknown op code %u", info);
-}
-
static void
out_target(char *buf, xl_heaptid *target)
{
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.21 2005/06/02 05:55:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.22 2005/06/06 17:01:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
static void
-btree_xlog_insert(bool redo, bool isleaf, bool ismeta,
+btree_xlog_insert(bool isleaf, bool ismeta,
XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_insert *xlrec = (xl_btree_insert *) XLogRecGetData(record);
datalen -= sizeof(xl_btree_metadata);
}
- if (redo && (record->xl_info & XLR_BKP_BLOCK_1) && !ismeta &&
+ if ((record->xl_info & XLR_BKP_BLOCK_1) && !ismeta &&
incomplete_splits == NIL)
return; /* nothing to do */
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
- if (!redo || !(record->xl_info & XLR_BKP_BLOCK_1))
+ if (!(record->xl_info & XLR_BKP_BLOCK_1))
{
buffer = XLogReadBuffer(false, reln,
ItemPointerGetBlockNumber(&(xlrec->target.tid)));
if (!BufferIsValid(buffer))
- elog(PANIC, "btree_insert_%sdo: block unfound", (redo) ? "re" : "un");
+ elog(PANIC, "btree_insert_redo: block unfound");
page = (Page) BufferGetPage(buffer);
if (PageIsNew((PageHeader) page))
- elog(PANIC, "btree_insert_%sdo: uninitialized page", (redo) ? "re" : "un");
+ elog(PANIC, "btree_insert_redo: uninitialized page");
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
- if (redo)
+ if (XLByteLE(lsn, PageGetLSN(page)))
{
- if (XLByteLE(lsn, PageGetLSN(page)))
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- }
- else
- {
- if (PageAddItem(page, (Item) datapos, datalen,
- ItemPointerGetOffsetNumber(&(xlrec->target.tid)),
- LP_USED) == InvalidOffsetNumber)
- elog(PANIC, "btree_insert_redo: failed to add item");
-
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- }
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ ReleaseBuffer(buffer);
}
else
{
- if (XLByteLT(PageGetLSN(page), lsn))
- elog(PANIC, "btree_insert_undo: bad page LSN");
+ if (PageAddItem(page, (Item) datapos, datalen,
+ ItemPointerGetOffsetNumber(&(xlrec->target.tid)),
+ LP_USED) == InvalidOffsetNumber)
+ elog(PANIC, "btree_insert_redo: failed to add item");
- if (!P_ISLEAF(pageop))
- {
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- ReleaseBuffer(buffer);
- }
- else
- elog(PANIC, "btree_insert_undo: unimplemented");
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
}
}
- if (redo) /* metapage changes not undoable */
- {
- if (ismeta)
- _bt_restore_meta(reln, lsn,
- md.root, md.level,
- md.fastroot, md.fastlevel);
- }
+ if (ismeta)
+ _bt_restore_meta(reln, lsn,
+ md.root, md.level,
+ md.fastroot, md.fastlevel);
/* Forget any split this insertion completes */
- if (redo && !isleaf && incomplete_splits != NIL)
+ if (!isleaf && incomplete_splits != NIL)
{
forget_matching_split(reln, xlrec->target.node,
ItemPointerGetBlockNumber(&(xlrec->target.tid)),
}
static void
-btree_xlog_split(bool redo, bool onleft, bool isroot,
+btree_xlog_split(bool onleft, bool isroot,
XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_split *xlrec = (xl_btree_split *) XLogRecGetData(record);
Buffer buffer;
Page page;
BTPageOpaque pageop;
- char *op = (redo) ? "redo" : "undo";
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
/* Left (original) sibling */
buffer = XLogReadBuffer(false, reln, leftsib);
if (!BufferIsValid(buffer))
- elog(PANIC, "btree_split_%s: lost left sibling", op);
+ elog(PANIC, "btree_split_redo: lost left sibling");
page = (Page) BufferGetPage(buffer);
- if (redo)
- _bt_pageinit(page, BufferGetPageSize(buffer));
- else if (PageIsNew((PageHeader) page))
- elog(PANIC, "btree_split_undo: uninitialized left sibling");
+ _bt_pageinit(page, BufferGetPageSize(buffer));
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
- if (redo)
- {
- pageop->btpo_prev = xlrec->leftblk;
- pageop->btpo_next = rightsib;
- pageop->btpo.level = xlrec->level;
- pageop->btpo_flags = (xlrec->level == 0) ? BTP_LEAF : 0;
+ pageop->btpo_prev = xlrec->leftblk;
+ pageop->btpo_next = rightsib;
+ pageop->btpo.level = xlrec->level;
+ pageop->btpo_flags = (xlrec->level == 0) ? BTP_LEAF : 0;
- _bt_restore_page(page,
- (char *) xlrec + SizeOfBtreeSplit,
- xlrec->leftlen);
+ _bt_restore_page(page,
+ (char *) xlrec + SizeOfBtreeSplit,
+ xlrec->leftlen);
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- }
- else
- {
- /* undo */
- if (XLByteLT(PageGetLSN(page), lsn))
- elog(PANIC, "btree_split_undo: bad left sibling LSN");
- elog(PANIC, "btree_split_undo: unimplemented");
- }
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
/* Right (new) sibling */
- buffer = XLogReadBuffer((redo) ? true : false, reln, rightsib);
+ buffer = XLogReadBuffer(true, reln, rightsib);
if (!BufferIsValid(buffer))
- elog(PANIC, "btree_split_%s: lost right sibling", op);
+ elog(PANIC, "btree_split_redo: lost right sibling");
page = (Page) BufferGetPage(buffer);
- if (redo)
- _bt_pageinit(page, BufferGetPageSize(buffer));
- else if (PageIsNew((PageHeader) page))
- elog(PANIC, "btree_split_undo: uninitialized right sibling");
+ _bt_pageinit(page, BufferGetPageSize(buffer));
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
- if (redo)
- {
- pageop->btpo_prev = leftsib;
- pageop->btpo_next = xlrec->rightblk;
- pageop->btpo.level = xlrec->level;
- pageop->btpo_flags = (xlrec->level == 0) ? BTP_LEAF : 0;
+ pageop->btpo_prev = leftsib;
+ pageop->btpo_next = xlrec->rightblk;
+ pageop->btpo.level = xlrec->level;
+ pageop->btpo_flags = (xlrec->level == 0) ? BTP_LEAF : 0;
- _bt_restore_page(page,
- (char *) xlrec + SizeOfBtreeSplit + xlrec->leftlen,
+ _bt_restore_page(page,
+ (char *) xlrec + SizeOfBtreeSplit + xlrec->leftlen,
record->xl_len - SizeOfBtreeSplit - xlrec->leftlen);
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- }
- else
- {
- /* undo */
- if (XLByteLT(PageGetLSN(page), lsn))
- elog(PANIC, "btree_split_undo: bad right sibling LSN");
- elog(PANIC, "btree_split_undo: unimplemented");
- }
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
/* Fix left-link of right (next) page */
- if (redo && !(record->xl_info & XLR_BKP_BLOCK_1))
+ if (!(record->xl_info & XLR_BKP_BLOCK_1))
{
if (xlrec->rightblk != P_NONE)
{
}
/* Forget any split this insertion completes */
- if (redo && xlrec->level > 0 && incomplete_splits != NIL)
+ if (xlrec->level > 0 && incomplete_splits != NIL)
{
forget_matching_split(reln, xlrec->target.node,
ItemPointerGetBlockNumber(&(xlrec->target.tid)),
}
static void
-btree_xlog_delete(bool redo, XLogRecPtr lsn, XLogRecord *record)
+btree_xlog_delete(XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_delete *xlrec;
Relation reln;
Buffer buffer;
Page page;
- if (!redo || (record->xl_info & XLR_BKP_BLOCK_1))
+ if (record->xl_info & XLR_BKP_BLOCK_1)
return;
xlrec = (xl_btree_delete *) XLogRecGetData(record);
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
buffer = XLogReadBuffer(false, reln, xlrec->block);
}
static void
-btree_xlog_delete_page(bool redo, bool ismeta,
+btree_xlog_delete_page(bool ismeta,
XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_delete_page *xlrec = (xl_btree_delete_page *) XLogRecGetData(record);
Buffer buffer;
Page page;
BTPageOpaque pageop;
- char *op = (redo) ? "redo" : "undo";
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->target.node);
+ reln = XLogOpenRelation(xlrec->target.node);
if (!RelationIsValid(reln))
return;
rightsib = xlrec->rightblk;
/* parent page */
- if (redo && !(record->xl_info & XLR_BKP_BLOCK_1))
+ if (!(record->xl_info & XLR_BKP_BLOCK_1))
{
buffer = XLogReadBuffer(false, reln, parent);
if (!BufferIsValid(buffer))
}
/* Fix left-link of right sibling */
- if (redo && !(record->xl_info & XLR_BKP_BLOCK_2))
+ if (!(record->xl_info & XLR_BKP_BLOCK_2))
{
buffer = XLogReadBuffer(false, reln, rightsib);
if (!BufferIsValid(buffer))
}
/* Fix right-link of left sibling, if any */
- if (redo && !(record->xl_info & XLR_BKP_BLOCK_3))
+ if (!(record->xl_info & XLR_BKP_BLOCK_3))
{
if (leftsib != P_NONE)
{
/* Rewrite target page as empty deleted page */
buffer = XLogReadBuffer(false, reln, target);
if (!BufferIsValid(buffer))
- elog(PANIC, "btree_delete_page_%s: lost target page", op);
+ elog(PANIC, "btree_delete_page_redo: lost target page");
page = (Page) BufferGetPage(buffer);
- if (redo)
- _bt_pageinit(page, BufferGetPageSize(buffer));
- else if (PageIsNew((PageHeader) page))
- elog(PANIC, "btree_delete_page_undo: uninitialized target page");
+ _bt_pageinit(page, BufferGetPageSize(buffer));
pageop = (BTPageOpaque) PageGetSpecialPointer(page);
- if (redo)
- {
- pageop->btpo_prev = leftsib;
- pageop->btpo_next = rightsib;
- pageop->btpo.xact = FrozenTransactionId;
- pageop->btpo_flags = BTP_DELETED;
+ pageop->btpo_prev = leftsib;
+ pageop->btpo_next = rightsib;
+ pageop->btpo.xact = FrozenTransactionId;
+ pageop->btpo_flags = BTP_DELETED;
- PageSetLSN(page, lsn);
- PageSetTLI(page, ThisTimeLineID);
- LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
- WriteBuffer(buffer);
- }
- else
- {
- /* undo */
- if (XLByteLT(PageGetLSN(page), lsn))
- elog(PANIC, "btree_delete_page_undo: bad left sibling LSN");
- elog(PANIC, "btree_delete_page_undo: unimplemented");
- }
+ PageSetLSN(page, lsn);
+ PageSetTLI(page, ThisTimeLineID);
+ LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
+ WriteBuffer(buffer);
/* Update metapage if needed */
- if (redo) /* metapage changes not undoable */
+ if (ismeta)
{
- if (ismeta)
- {
- xl_btree_metadata md;
+ xl_btree_metadata md;
- memcpy(&md, (char *) xlrec + SizeOfBtreeDeletePage,
- sizeof(xl_btree_metadata));
- _bt_restore_meta(reln, lsn,
- md.root, md.level,
- md.fastroot, md.fastlevel);
- }
+ memcpy(&md, (char *) xlrec + SizeOfBtreeDeletePage,
+ sizeof(xl_btree_metadata));
+ _bt_restore_meta(reln, lsn,
+ md.root, md.level,
+ md.fastroot, md.fastlevel);
}
}
static void
-btree_xlog_newroot(bool redo, XLogRecPtr lsn, XLogRecord *record)
+btree_xlog_newroot(XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_newroot *xlrec = (xl_btree_newroot *) XLogRecGetData(record);
Relation reln;
Page page;
BTPageOpaque pageop;
- if (!redo)
- return; /* not undoable */
-
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
buffer = XLogReadBuffer(true, reln, xlrec->rootblk);
}
static void
-btree_xlog_newmeta(bool redo, XLogRecPtr lsn, XLogRecord *record)
+btree_xlog_newmeta(XLogRecPtr lsn, XLogRecord *record)
{
xl_btree_newmeta *xlrec = (xl_btree_newmeta *) XLogRecGetData(record);
Relation reln;
- if (!redo)
- return; /* not undoable */
-
- reln = XLogOpenRelation(redo, RM_BTREE_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
switch (info)
{
case XLOG_BTREE_INSERT_LEAF:
- btree_xlog_insert(true, true, false, lsn, record);
+ btree_xlog_insert(true, false, lsn, record);
break;
case XLOG_BTREE_INSERT_UPPER:
- btree_xlog_insert(true, false, false, lsn, record);
+ btree_xlog_insert(false, false, lsn, record);
break;
case XLOG_BTREE_INSERT_META:
- btree_xlog_insert(true, false, true, lsn, record);
+ btree_xlog_insert(false, true, lsn, record);
break;
case XLOG_BTREE_SPLIT_L:
- btree_xlog_split(true, true, false, lsn, record);
+ btree_xlog_split(true, false, lsn, record);
break;
case XLOG_BTREE_SPLIT_R:
- btree_xlog_split(true, false, false, lsn, record);
+ btree_xlog_split(false, false, lsn, record);
break;
case XLOG_BTREE_SPLIT_L_ROOT:
- btree_xlog_split(true, true, true, lsn, record);
+ btree_xlog_split(true, true, lsn, record);
break;
case XLOG_BTREE_SPLIT_R_ROOT:
- btree_xlog_split(true, false, true, lsn, record);
+ btree_xlog_split(false, true, lsn, record);
break;
case XLOG_BTREE_DELETE:
- btree_xlog_delete(true, lsn, record);
+ btree_xlog_delete(lsn, record);
break;
case XLOG_BTREE_DELETE_PAGE:
- btree_xlog_delete_page(true, false, lsn, record);
+ btree_xlog_delete_page(false, lsn, record);
break;
case XLOG_BTREE_DELETE_PAGE_META:
- btree_xlog_delete_page(true, true, lsn, record);
+ btree_xlog_delete_page(true, lsn, record);
break;
case XLOG_BTREE_NEWROOT:
- btree_xlog_newroot(true, lsn, record);
+ btree_xlog_newroot(lsn, record);
break;
case XLOG_BTREE_NEWMETA:
- btree_xlog_newmeta(true, lsn, record);
+ btree_xlog_newmeta(lsn, record);
break;
default:
elog(PANIC, "btree_redo: unknown op code %u", info);
}
}
-void
-btree_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- uint8 info = record->xl_info & ~XLR_INFO_MASK;
-
- switch (info)
- {
- case XLOG_BTREE_INSERT_LEAF:
- btree_xlog_insert(false, true, false, lsn, record);
- break;
- case XLOG_BTREE_INSERT_UPPER:
- btree_xlog_insert(false, false, false, lsn, record);
- break;
- case XLOG_BTREE_INSERT_META:
- btree_xlog_insert(false, false, true, lsn, record);
- break;
- case XLOG_BTREE_SPLIT_L:
- btree_xlog_split(false, true, false, lsn, record);
- break;
- case XLOG_BTREE_SPLIT_R:
- btree_xlog_split(false, false, false, lsn, record);
- break;
- case XLOG_BTREE_SPLIT_L_ROOT:
- btree_xlog_split(false, true, true, lsn, record);
- break;
- case XLOG_BTREE_SPLIT_R_ROOT:
- btree_xlog_split(false, false, true, lsn, record);
- break;
- case XLOG_BTREE_DELETE:
- btree_xlog_delete(false, lsn, record);
- break;
- case XLOG_BTREE_DELETE_PAGE:
- btree_xlog_delete_page(false, false, lsn, record);
- break;
- case XLOG_BTREE_DELETE_PAGE_META:
- btree_xlog_delete_page(false, true, lsn, record);
- break;
- case XLOG_BTREE_NEWROOT:
- btree_xlog_newroot(false, lsn, record);
- break;
- case XLOG_BTREE_NEWMETA:
- btree_xlog_newmeta(false, lsn, record);
- break;
- default:
- elog(PANIC, "btree_undo: unknown op code %u", info);
- }
-}
-
static void
out_target(char *buf, xl_btreetid *target)
{
rpageop;
bool is_only;
- reln = XLogOpenRelation(true, RM_BTREE_ID, split->node);
+ reln = XLogOpenRelation(split->node);
if (!RelationIsValid(reln))
continue;
lbuf = XLogReadBuffer(false, reln, split->leftblk);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.89 2005/05/11 06:24:54 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.90 2005/06/06 17:01:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "rtree_redo: unimplemented");
}
-void
-rtree_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- elog(PANIC, "rtree_undo: unimplemented");
-}
-
void
rtree_desc(char *buf, uint8 xl_info, char *rec)
{
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.28 2004/12/31 21:59:29 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.29 2005/06/06 17:01:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
}
}
-void
-clog_undo(XLogRecPtr lsn, XLogRecord *record)
-{
-}
-
void
clog_desc(char *buf, uint8 xl_info, char *rec)
{
*
* Resource managers definition
*
- * $PostgreSQL: pgsql/src/backend/access/transam/rmgr.c,v 1.17 2005/05/17 03:34:18 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/rmgr.c,v 1.18 2005/06/06 17:01:22 tgl Exp $
*/
#include "postgres.h"
const RmgrData RmgrTable[RM_MAX_ID + 1] = {
- {"XLOG", xlog_redo, xlog_undo, xlog_desc, NULL, NULL},
- {"Transaction", xact_redo, xact_undo, xact_desc, NULL, NULL},
- {"Storage", smgr_redo, smgr_undo, smgr_desc, NULL, NULL},
- {"CLOG", clog_redo, clog_undo, clog_desc, NULL, NULL},
- {"Database", dbase_redo, dbase_undo, dbase_desc, NULL, NULL},
- {"Tablespace", tblspc_redo, tblspc_undo, tblspc_desc, NULL, NULL},
- {"Reserved 6", NULL, NULL, NULL, NULL, NULL},
- {"Reserved 7", NULL, NULL, NULL, NULL, NULL},
- {"Reserved 8", NULL, NULL, NULL, NULL, NULL},
- {"Reserved 9", NULL, NULL, NULL, NULL, NULL},
- {"Heap", heap_redo, heap_undo, heap_desc, NULL, NULL},
- {"Btree", btree_redo, btree_undo, btree_desc,
- btree_xlog_startup, btree_xlog_cleanup},
- {"Hash", hash_redo, hash_undo, hash_desc, NULL, NULL},
- {"Rtree", rtree_redo, rtree_undo, rtree_desc, NULL, NULL},
- {"Gist", gist_redo, gist_undo, gist_desc, NULL, NULL},
- {"Sequence", seq_redo, seq_undo, seq_desc, NULL, NULL}
+ {"XLOG", xlog_redo, xlog_desc, NULL, NULL},
+ {"Transaction", xact_redo, xact_desc, NULL, NULL},
+ {"Storage", smgr_redo, smgr_desc, NULL, NULL},
+ {"CLOG", clog_redo, clog_desc, NULL, NULL},
+ {"Database", dbase_redo, dbase_desc, NULL, NULL},
+ {"Tablespace", tblspc_redo, tblspc_desc, NULL, NULL},
+ {"Reserved 6", NULL, NULL, NULL, NULL},
+ {"Reserved 7", NULL, NULL, NULL, NULL},
+ {"Reserved 8", NULL, NULL, NULL, NULL},
+ {"Reserved 9", NULL, NULL, NULL, NULL},
+ {"Heap", heap_redo, heap_desc, NULL, NULL},
+ {"Btree", btree_redo, btree_desc, btree_xlog_startup, btree_xlog_cleanup},
+ {"Hash", hash_redo, hash_desc, NULL, NULL},
+ {"Rtree", rtree_redo, rtree_desc, NULL, NULL},
+ {"Gist", gist_redo, gist_desc, NULL, NULL},
+ {"Sequence", seq_redo, seq_desc, NULL, NULL}
};
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.202 2005/05/19 23:58:51 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.203 2005/06/06 17:01:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "xact_redo: unknown op code %u", info);
}
-void
-xact_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- uint8 info = record->xl_info & ~XLR_INFO_MASK;
-
- if (info == XLOG_XACT_COMMIT) /* shouldn't be called by XLOG */
- elog(PANIC, "xact_undo: can't undo committed xaction");
- else if (info != XLOG_XACT_ABORT)
- elog(PANIC, "xact_redo: unknown op code %u", info);
-}
-
void
xact_desc(char *buf, uint8 xl_info, char *rec)
{
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.195 2005/06/02 05:55:28 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.196 2005/06/06 17:01:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
memcpy(&bkpb, blk, sizeof(BkpBlock));
blk += sizeof(BkpBlock);
- reln = XLogOpenRelation(true, record->xl_rmid, bkpb.node);
+ reln = XLogOpenRelation(bkpb.node);
if (reln)
{
}
}
-void
-xlog_undo(XLogRecPtr lsn, XLogRecord *record)
-{
-}
-
void
xlog_desc(char *buf, uint8 xl_info, char *rec)
{
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.37 2005/05/29 04:23:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xlogutils.c,v 1.38 2005/06/06 17:01:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* Open a relation during XLOG replay
*/
Relation
-XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode)
+XLogOpenRelation(RelFileNode rnode)
{
XLogRelDesc *res;
XLogRelCacheEntry *hentry;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.157 2005/05/19 21:35:45 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.158 2005/06/06 17:01:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "dbase_redo: unknown op code %u", info);
}
-void
-dbase_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- elog(PANIC, "dbase_undo: unimplemented");
-}
-
void
dbase_desc(char *buf, uint8 xl_info, char *rec)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.120 2005/05/27 00:57:49 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.121 2005/06/06 17:01:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
if (info != XLOG_SEQ_LOG)
elog(PANIC, "seq_redo: unknown op code %u", info);
- reln = XLogOpenRelation(true, RM_SEQ_ID, xlrec->node);
+ reln = XLogOpenRelation(xlrec->node);
if (!RelationIsValid(reln))
return;
WriteBuffer(buffer);
}
-void
-seq_undo(XLogRecPtr lsn, XLogRecord *record)
-{
-}
-
void
seq_desc(char *buf, uint8 xl_info, char *rec)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.19 2005/05/10 22:27:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.20 2005/06/06 17:01:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "tblspc_redo: unknown op code %u", info);
}
-void
-tblspc_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- elog(PANIC, "tblspc_undo: unimplemented");
-}
-
void
tblspc_desc(char *buf, uint8 xl_info, char *rec)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.87 2005/05/29 04:23:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.88 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
elog(PANIC, "smgr_redo: unknown op code %u", info);
}
-void
-smgr_undo(XLogRecPtr lsn, XLogRecord *record)
-{
- /* Since we have no transactional WAL entries, should never undo */
- elog(PANIC, "smgr_undo: cannot undo");
-}
-
void
smgr_desc(char *buf, uint8 xl_info, char *rec)
{
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.6 2005/04/14 20:03:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/flatfiles.c,v 1.7 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
rnode.relNode = DatabaseRelationId;
/* No locking is needed because no one else is alive yet */
- rel = XLogOpenRelation(true, 0, rnode);
+ rel = XLogOpenRelation(rnode);
write_database_file(rel);
if (!database_only)
rnode.dbNode = 0;
rnode.relNode = GroupRelationId;
- rel = XLogOpenRelation(true, 0, rnode);
+ rel = XLogOpenRelation(rnode);
write_group_file(rel);
/* hard-wired path to pg_shadow */
rnode.dbNode = 0;
rnode.relNode = ShadowRelationId;
- rel = XLogOpenRelation(true, 0, rnode);
+ rel = XLogOpenRelation(rnode);
write_user_file(rel);
}
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/clog.h,v 1.12 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/clog.h,v 1.13 2005/06/06 17:01:24 tgl Exp $
*/
#ifndef CLOG_H
#define CLOG_H
#define CLOG_ZEROPAGE 0x00
extern void clog_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void clog_undo(XLogRecPtr lsn, XLogRecord *record);
extern void clog_desc(char *buf, uint8 xl_info, char *rec);
#endif /* CLOG_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.1 2005/05/17 03:34:18 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/access/gist_private.h,v 1.2 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void gistdentryinit(GISTSTATE *giststate, int nkey, GISTENTRY *e,
Datum k, Relation r, Page pg, OffsetNumber o,
int b, bool l, bool isNull);
+
extern void gist_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void gist_undo(XLogRecPtr lsn, XLogRecord *record);
extern void gist_desc(char *buf, uint8 xl_info, char *rec);
/* gistget.c */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.61 2005/03/27 23:53:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/hash.h,v 1.62 2005/06/06 17:01:24 tgl Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
/* hash.c */
extern void hash_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void hash_undo(XLogRecPtr lsn, XLogRecord *record);
extern void hash_desc(char *buf, uint8 xl_info, char *rec);
#endif /* HASH_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.100 2005/04/28 21:47:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/heapam.h,v 1.101 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void heap_restrpos(HeapScanDesc scan);
extern void heap_redo(XLogRecPtr lsn, XLogRecord *rptr);
-extern void heap_undo(XLogRecPtr lsn, XLogRecord *rptr);
extern void heap_desc(char *buf, uint8 xl_info, char *rec);
extern XLogRecPtr log_heap_clean(Relation reln, Buffer buffer,
OffsetNumber *unused, int uncnt);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.85 2005/03/27 23:53:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.86 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
* prototypes for functions in nbtxlog.c
*/
extern void btree_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void btree_undo(XLogRecPtr lsn, XLogRecord *record);
extern void btree_desc(char *buf, uint8 xl_info, char *rec);
extern void btree_xlog_startup(void);
extern void btree_xlog_cleanup(void);
*
* Resource managers definition
*
- * $PostgreSQL: pgsql/src/include/access/rmgr.h,v 1.13 2004/08/29 21:08:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/rmgr.h,v 1.14 2005/06/06 17:01:24 tgl Exp $
*/
#ifndef RMGR_H
#define RMGR_H
#define RM_CLOG_ID 3
#define RM_DBASE_ID 4
#define RM_TBLSPC_ID 5
+#define RM_MULTIXACT_ID 6
#define RM_HEAP_ID 10
#define RM_BTREE_ID 11
#define RM_HASH_ID 12
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/rtree.h,v 1.38 2005/03/27 23:53:04 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/rtree.h,v 1.39 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void _rtdump(Relation r);
extern void rtree_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void rtree_undo(XLogRecPtr lsn, XLogRecord *record);
extern void rtree_desc(char *buf, uint8 xl_info, char *rec);
/* rtscan.c */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xact.h,v 1.75 2005/03/28 01:50:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/xact.h,v 1.76 2005/06/06 17:01:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern int xactGetCommittedChildren(TransactionId **ptr);
extern void xact_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void xact_undo(XLogRecPtr lsn, XLogRecord *record);
extern void xact_desc(char *buf, uint8 xl_info, char *rec);
#endif /* XACT_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.62 2005/06/02 05:55:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.63 2005/06/06 17:01:24 tgl Exp $
*/
#ifndef XLOG_H
#define XLOG_H
extern void XLogFlush(XLogRecPtr RecPtr);
extern void xlog_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void xlog_undo(XLogRecPtr lsn, XLogRecord *record);
extern void xlog_desc(char *buf, uint8 xl_info, char *rec);
extern void UpdateControlFile(void);
*
* NOTE: this file is intended to contain declarations useful for
* manipulating the XLOG files directly, but it is not supposed to be
- * needed by rmgr routines (redo/undo support for individual record types).
+ * needed by rmgr routines (redo support for individual record types).
* So the XLogRecord typedef and associated stuff appear in xlog.h.
*
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.7 2005/06/02 05:55:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog_internal.h,v 1.8 2005/06/06 17:01:25 tgl Exp $
*/
#ifndef XLOG_INTERNAL_H
#define XLOG_INTERNAL_H
{
const char *rm_name;
void (*rm_redo) (XLogRecPtr lsn, XLogRecord *rptr);
- void (*rm_undo) (XLogRecPtr lsn, XLogRecord *rptr);
void (*rm_desc) (char *buf, uint8 xl_info, char *rec);
void (*rm_startup) (void);
void (*rm_cleanup) (void);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlogutils.h,v 1.17 2004/12/31 22:03:21 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlogutils.h,v 1.18 2005/06/06 17:01:25 tgl Exp $
*/
#ifndef XLOG_UTILS_H
#define XLOG_UTILS_H
-#include "access/rmgr.h"
#include "storage/buf.h"
#include "utils/rel.h"
extern void XLogInitRelationCache(void);
extern void XLogCloseRelationCache(void);
-extern Relation XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode);
+extern Relation XLogOpenRelation(RelFileNode rnode);
extern void XLogCloseRelation(RelFileNode rnode);
extern Buffer XLogReadBuffer(bool extend, Relation reln, BlockNumber blkno);
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/dbcommands.h,v 1.37 2005/03/23 00:03:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/commands/dbcommands.h,v 1.38 2005/06/06 17:01:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern char *get_database_name(Oid dbid);
extern void dbase_redo(XLogRecPtr lsn, XLogRecord *rptr);
-extern void dbase_undo(XLogRecPtr lsn, XLogRecord *rptr);
extern void dbase_desc(char *buf, uint8 xl_info, char *rec);
#endif /* DBCOMMANDS_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.30 2004/12/31 22:03:28 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/commands/sequence.h,v 1.31 2005/06/06 17:01:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void AlterSequence(AlterSeqStmt *stmt);
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
-extern void seq_undo(XLogRecPtr lsn, XLogRecord *rptr);
extern void seq_desc(char *buf, uint8 xl_info, char *rec);
/* Set the upper and lower bounds of a sequence */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.8 2004/12/31 22:03:28 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/commands/tablespace.h,v 1.9 2005/06/06 17:01:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern bool directory_is_empty(const char *path);
extern void tblspc_redo(XLogRecPtr lsn, XLogRecord *rptr);
-extern void tblspc_undo(XLogRecPtr lsn, XLogRecord *rptr);
extern void tblspc_desc(char *buf, uint8 xl_info, char *rec);
#endif /* TABLESPACE_H */
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.50 2005/01/10 20:02:23 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/storage/smgr.h,v 1.51 2005/06/06 17:01:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
extern void smgrsync(void);
extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record);
-extern void smgr_undo(XLogRecPtr lsn, XLogRecord *record);
extern void smgr_desc(char *buf, uint8 xl_info, char *rec);