Commit 2589735d authored by Tom Lane's avatar Tom Lane

Replace implementation of pg_log as a relation accessed through the

buffer manager with 'pg_clog', a specialized access method modeled
on pg_xlog.  This simplifies startup (don't need to play games to
open pg_log; among other things, OverrideTransactionSystem goes away),
should improve performance a little, and opens the door to recycling
commit log space by removing no-longer-needed segments of the commit
log.  Actual recycling is not there yet, but I felt I should commit
this part separately since it'd still be useful if we chose not to
do transaction ID wraparound.
parent 4699d81d
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.11 2001/08/16 04:30:41 ishii Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/backup.sgml,v 2.12 2001/08/25 18:52:41 tgl Exp $ -->
<chapter id="backup">
<title>Backup and Restore</title>
......@@ -339,11 +339,11 @@ tar -cf backup.tar /usr/local/pgsql/data
individual tables or databases from their respective files or
directories. This will <emphasis>not</> work because the
information contained in these files contains only half the
truth. The other half is in the file
<filename>pg_log</filename>, which contains the commit status of
truth. The other half is in the commit log files
<filename>pg_clog/*</filename>, which contain the commit status of
all transactions. A table file is only usable with this
information. Of course it is also impossible to restore only a
table and the associated <filename>pg_log</filename> file
table and the associated <filename>pg_clog</filename> data
because that will render all other tables in the database
cluster useless.
</para>
......
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.7 2001/05/17 21:50:16 petere Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/wal.sgml,v 1.8 2001/08/25 18:52:41 tgl Exp $ -->
<chapter id="wal">
<title>Write-Ahead Logging (<acronym>WAL</acronym>)</title>
......@@ -83,12 +83,12 @@
In this first release of <acronym>WAL</acronym>, UNDO operation is
not implemented, because of lack of time. This means that changes
made by aborted transactions will still occupy disk space and that
we still need a permanent <filename>pg_log</filename> file to hold
we still need a permanent <filename>pg_clog</filename> file to hold
the status of transactions, since we are not able to re-use
transaction identifiers. Once UNDO is implemented,
<filename>pg_log</filename> will no longer be required to be
<filename>pg_clog</filename> will no longer be required to be
permanent; it will be possible to remove
<filename>pg_log</filename> at shutdown, split it into segments
<filename>pg_clog</filename> at shutdown, split it into segments
and remove old segments.
</para>
......
......@@ -4,7 +4,7 @@
# Makefile for access/transam
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.14 2001/08/24 14:07:48 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/access/transam/Makefile,v 1.15 2001/08/25 18:52:41 tgl Exp $
#
#-------------------------------------------------------------------------
......@@ -12,7 +12,7 @@ subdir = src/backend/access/transam
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
OBJS = transam.o transsup.o varsup.o xact.o xid.o xlog.o xlogutils.o rmgr.o
OBJS = clog.o transam.o varsup.o xact.o xid.o xlog.o xlogutils.o rmgr.o
all: SUBSYS.o
......
This diff is collapsed.
/*
* rmgr.c
*
* Resource managers definition
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/rmgr.c,v 1.9 2001/08/25 18:52:41 tgl Exp $
*/
#include "postgres.h"
#include "access/clog.h"
#include "access/gist.h"
#include "access/hash.h"
#include "access/heapam.h"
......@@ -9,11 +18,12 @@
#include "storage/smgr.h"
#include "commands/sequence.h"
RmgrData RmgrTable[] = {
{"XLOG", xlog_redo, xlog_undo, xlog_desc},
{"Transaction", xact_redo, xact_undo, xact_desc},
{"Storage", smgr_redo, smgr_undo, smgr_desc},
{"Reserved 3", NULL, NULL, NULL},
{"CLOG", clog_redo, clog_undo, clog_desc},
{"Reserved 4", NULL, NULL, NULL},
{"Reserved 5", NULL, NULL, NULL},
{"Reserved 6", NULL, NULL, NULL},
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,15 +6,15 @@
* Copyright (c) 2000, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.44 2001/08/23 23:06:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.45 2001/08/25 18:52:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/clog.h"
#include "access/transam.h"
#include "access/xlog.h"
#include "storage/proc.h"
......@@ -32,25 +32,34 @@ VariableCache ShmemVariableCache = NULL;
/*
* Allocate the next XID for my new transaction.
*/
void
GetNewTransactionId(TransactionId *xid)
TransactionId
GetNewTransactionId(void)
{
TransactionId xid;
/*
* During bootstrap initialization, we return the special bootstrap
* transaction id.
*/
if (AMI_OVERRIDE)
{
*xid = BootstrapTransactionId;
return;
}
return BootstrapTransactionId;
SpinAcquire(XidGenLockId);
*xid = ShmemVariableCache->nextXid;
xid = ShmemVariableCache->nextXid;
TransactionIdAdvance(ShmemVariableCache->nextXid);
/*
* If we have just allocated the first XID of a new page of the
* commit log, zero out that commit-log page before returning.
* We must do this while holding XidGenLock, else another xact could
* acquire and commit a later XID before we zero the page. Fortunately,
* a page of the commit log holds 32K or more transactions, so we don't
* have to do this very often.
*/
ExtendCLOG(xid);
/*
* Must set MyProc->xid before releasing XidGenLock. This ensures that
* when GetSnapshotData calls ReadNewTransactionId, all active XIDs
......@@ -72,30 +81,33 @@ GetNewTransactionId(TransactionId *xid)
* removed while holding the lock.)
*/
if (MyProc != (PROC *) NULL)
MyProc->xid = *xid;
MyProc->xid = xid;
SpinRelease(XidGenLockId);
return xid;
}
/*
* Read nextXid but don't allocate it.
*/
void
ReadNewTransactionId(TransactionId *xid)
TransactionId
ReadNewTransactionId(void)
{
TransactionId xid;
/*
* During bootstrap initialization, we return the special bootstrap
* transaction id.
*/
if (AMI_OVERRIDE)
{
*xid = BootstrapTransactionId;
return;
}
return BootstrapTransactionId;
SpinAcquire(XidGenLockId);
*xid = ShmemVariableCache->nextXid;
xid = ShmemVariableCache->nextXid;
SpinRelease(XidGenLockId);
return xid;
}
/* ----------------------------------------------------------------
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.108 2001/07/16 22:43:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.109 2001/08/25 18:52:41 tgl Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
......@@ -228,22 +228,6 @@ int CommitSiblings = 5; /* number of concurrent xacts needed to
static void (*_RollbackFunc) (void *) = NULL;
static void *_RollbackData = NULL;
/* ----------------
* info returned when the system is disabled
*
* Apparently a lot of this code is inherited from other prototype systems.
*
* For DisabledStartTime, use a symbolic value to make the relationships clearer.
* The old value of 1073741823 corresponds to a date in y2004, which is coming closer
* every day. It appears that if we return a value guaranteed larger than
* any real time associated with a transaction then comparisons in other
* modules will still be correct. Let's use BIG_ABSTIME for this. tgl 2/14/97
* ----------------
*/
static CommandId DisabledCommandId = (CommandId) -1;
static AbsoluteTime DisabledStartTime = (AbsoluteTime) BIG_ABSTIME;
/* ----------------
* catalog creation transaction bootstrapping flag.
* This should be eliminated and added to the transaction
......@@ -309,8 +293,6 @@ IsTransactionState(void)
return true;
case TRANS_ABORT:
return true;
case TRANS_DISABLED:
return false;
}
/*
......@@ -339,44 +321,9 @@ IsAbortedTransactionBlockState(void)
return false;
}
/* --------------------------------
* OverrideTransactionSystem
*
* This is used to temporarily disable the transaction
* processing system in order to do initialization of
* the transaction system data structures and relations
* themselves.
* --------------------------------
*/
static int SavedTransactionState;
void
OverrideTransactionSystem(bool flag)
{
TransactionState s = CurrentTransactionState;
if (flag == true)
{
if (s->state == TRANS_DISABLED)
return;
SavedTransactionState = s->state;
s->state = TRANS_DISABLED;
}
else
{
if (s->state != TRANS_DISABLED)
return;
s->state = SavedTransactionState;
}
}
/* --------------------------------
* GetCurrentTransactionId
*
* This returns the id of the current transaction, or
* the id of the "disabled" transaction.
* --------------------------------
*/
TransactionId
......@@ -384,16 +331,6 @@ GetCurrentTransactionId(void)
{
TransactionState s = CurrentTransactionState;
/*
* if the transaction system is disabled, we return the special
* "disabled" transaction id.
*/
if (s->state == TRANS_DISABLED)
return DisabledTransactionId;
/*
* otherwise return the current transaction id.
*/
return s->transactionIdData;
}
......@@ -407,13 +344,6 @@ GetCurrentCommandId(void)
{
TransactionState s = CurrentTransactionState;
/*
* if the transaction system is disabled, we return the special
* "disabled" command id.
*/
if (s->state == TRANS_DISABLED)
return DisabledCommandId;
return s->commandId;
}
......@@ -422,13 +352,6 @@ GetScanCommandId(void)
{
TransactionState s = CurrentTransactionState;
/*
* if the transaction system is disabled, we return the special
* "disabled" command id.
*/
if (s->state == TRANS_DISABLED)
return DisabledCommandId;
return s->scanCommandId;
}
......@@ -442,13 +365,6 @@ GetCurrentTransactionStartTime(void)
{
TransactionState s = CurrentTransactionState;
/*
* if the transaction system is disabled, we return the special
* "disabled" starting time.
*/
if (s->state == TRANS_DISABLED)
return DisabledStartTime;
return s->startTime;
}
......@@ -523,16 +439,6 @@ SetScanCommandId(CommandId savedId)
CurrentTransactionStateData.scanCommandId = savedId;
}
/* ----------------------------------------------------------------
* initialization stuff
* ----------------------------------------------------------------
*/
void
InitializeTransactionSystem(void)
{
InitializeTransactionLog();
}
/* ----------------------------------------------------------------
* StartTransaction stuff
* ----------------------------------------------------------------
......@@ -617,15 +523,19 @@ AtStart_Memory(void)
* --------------------------------
*/
void
RecordTransactionCommit()
RecordTransactionCommit(void)
{
TransactionId xid;
bool leak;
xid = GetCurrentTransactionId();
leak = BufferPoolCheckLeak();
xid = GetCurrentTransactionId();
/*
* We needn't write anything in xlog or clog if the transaction was
* read-only, which we check by testing if it made any xlog entries.
*/
if (MyLastRecPtr.xrecoff != 0)
{
XLogRecData rdata;
......@@ -673,6 +583,7 @@ RecordTransactionCommit()
/* Break the chain of back-links in the XLOG records I output */
MyLastRecPtr.xrecoff = 0;
/* Mark the transaction committed in clog */
TransactionIdCommit(xid);
END_CRIT_SECTION();
......@@ -765,7 +676,10 @@ RecordTransactionAbort(void)
TransactionId xid = GetCurrentTransactionId();
/*
* Double check here is to catch case that we aborted partway through
* We needn't write anything in xlog or clog if the transaction was
* read-only, which we check by testing if it made any xlog entries.
*
* Extra check here is to catch case that we aborted partway through
* RecordTransactionCommit ...
*/
if (MyLastRecPtr.xrecoff != 0 && !TransactionIdDidCommit(xid))
......@@ -782,8 +696,17 @@ RecordTransactionAbort(void)
START_CRIT_SECTION();
/*
* SHOULD SAVE ARRAY OF RELFILENODE-s TO DROP
*/
recptr = XLogInsert(RM_XACT_ID, XLOG_XACT_ABORT, &rdata);
/*
* There's no need for XLogFlush here, since the default assumption
* would be that we aborted, anyway.
*/
/* Mark the transaction aborted in clog */
TransactionIdAbort(xid);
END_CRIT_SECTION();
......@@ -913,7 +836,7 @@ StartTransaction(void)
* fix to a communications problem, and we keep having to deal with it
* here. We should fix the comm channel code. mao 080891
*/
if (s->state == TRANS_DISABLED || s->state == TRANS_INPROGRESS)
if (s->state == TRANS_INPROGRESS)
return;
/*
......@@ -927,7 +850,7 @@ StartTransaction(void)
/*
* generate a new transaction id
*/
GetNewTransactionId(&(s->transactionIdData));
s->transactionIdData = GetNewTransactionId();
XactLockTableInsert(s->transactionIdData);
......@@ -984,11 +907,8 @@ CommitTransaction(void)
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
return;
if (s->state != TRANS_INPROGRESS)
elog(NOTICE, "CommitTransaction and not in in-progress state ");
elog(NOTICE, "CommitTransaction and not in in-progress state");
/*
* Tell the trigger manager that this transaction is about to be
......@@ -1109,12 +1029,6 @@ AbortTransaction(void)
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
{
RESUME_INTERRUPTS();
return;
}
if (s->state != TRANS_INPROGRESS)
elog(NOTICE, "AbortTransaction and not in in-progress state");
......@@ -1138,7 +1052,7 @@ AbortTransaction(void)
CloseSequences();
AtEOXact_portals();
/* Advertise the fact that we aborted in pg_log. */
/* Advertise the fact that we aborted in pg_clog. */
RecordTransactionAbort();
/*
......@@ -1191,9 +1105,6 @@ CleanupTransaction(void)
{
TransactionState s = CurrentTransactionState;
if (s->state == TRANS_DISABLED)
return;
/*
* State should still be TRANS_ABORT from AbortTransaction().
*/
......@@ -1464,9 +1375,6 @@ BeginTransactionBlock(void)
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
return;
if (s->blockState != TBLOCK_DEFAULT)
elog(NOTICE, "BEGIN: already a transaction in progress");
......@@ -1498,9 +1406,6 @@ EndTransactionBlock(void)
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
return;
if (s->blockState == TBLOCK_INPROGRESS)
{
......@@ -1552,9 +1457,6 @@ AbortTransactionBlock(void)
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
return;
if (s->blockState == TBLOCK_INPROGRESS)
{
......@@ -1591,12 +1493,6 @@ UserAbortTransactionBlock(void)
{
TransactionState s = CurrentTransactionState;
/*
* check the current transaction state
*/
if (s->state == TRANS_DISABLED)
return;
/*
* if the transaction has already been automatically aborted with an
* error, and the user subsequently types 'abort', allow it. (the
......@@ -1665,7 +1561,6 @@ AbortOutOfAnyTransaction(void)
CleanupTransaction();
break;
case TRANS_DEFAULT:
case TRANS_DISABLED:
/* Not in a transaction, do nothing */
break;
}
......@@ -1700,7 +1595,10 @@ xact_redo(XLogRecPtr lsn, XLogRecord *record)
/* SHOULD REMOVE FILES OF ALL DROPPED RELATIONS */
}
else if (info == XLOG_XACT_ABORT)
{
TransactionIdAbort(record->xl_xid);
/* SHOULD REMOVE FILES OF ALL FAILED-TO-BE-CREATED RELATIONS */
}
else
elog(STOP, "xact_redo: unknown op code %u", info);
}
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.74 2001/08/23 23:06:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.75 2001/08/25 18:52:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -26,8 +26,11 @@
#include <locale.h>
#endif
#include "access/clog.h"
#include "access/transam.h"
#include "access/xact.h"
#include "access/xlog.h"
#include "access/xlogutils.h"
#include "catalog/catversion.h"
#include "catalog/pg_control.h"
#include "storage/sinval.h"
......@@ -35,8 +38,6 @@
#include "storage/spin.h"
#include "storage/s_lock.h"
#include "storage/bufpage.h"
#include "access/xlog.h"
#include "access/xlogutils.h"
#include "utils/builtins.h"
#include "utils/relcache.h"
#include "utils/selfuncs.h"
......@@ -1580,7 +1581,7 @@ MoveOfflineLogs(uint32 log, uint32 seg, XLogRecPtr endptr)
strspn(xlde->d_name, "0123456789ABCDEF") == 16 &&
strcmp(xlde->d_name, lastoff) <= 0)
{
sprintf(path, "%s/%s", XLogDir, xlde->d_name);
snprintf(path, MAXPGPATH, "%s/%s", XLogDir, xlde->d_name);
if (XLOG_archive_dir[0])
{
elog(LOG, "archiving transaction log file %s",
......@@ -2409,6 +2410,9 @@ BootStrapXLOG(void)
/* some additional ControlFile fields are set in WriteControlFile() */
WriteControlFile();
/* Bootstrap the commit log, too */
BootStrapCLOG();
}
static char *
......@@ -2543,7 +2547,6 @@ StartupXLOG(void)
ControlFile->time = time(NULL);
UpdateControlFile();
XLogOpenLogRelation(); /* open pg_log */
XLogInitRelationCache();
/* Is REDO required ? */
......@@ -2724,6 +2727,9 @@ StartupXLOG(void)
ThisStartUpID++;
XLogCtl->ThisStartUpID = ThisStartUpID;
/* Start up the commit log, too */
StartupCLOG();
elog(LOG, "database system is ready");
CritSectionCount--;
......@@ -2845,6 +2851,7 @@ ShutdownXLOG(void)
CritSectionCount++;
CreateDummyCaches();
CreateCheckPoint(true);
ShutdownCLOG();
CritSectionCount--;
elog(LOG, "database system is shut down");
......@@ -2981,6 +2988,9 @@ CreateCheckPoint(bool shutdown)
*/
FlushBufferPool();
/* And commit-log buffers, too */
CheckPointCLOG();
/*
* Now insert the checkpoint record into XLOG.
*/
......
......@@ -6,24 +6,21 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.17 2001/08/23 23:06:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlogutils.c,v 1.18 2001/08/25 18:52:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/xlog.h"
#include "access/transam.h"
#include "access/xact.h"
#include "storage/bufpage.h"
#include "storage/bufmgr.h"
#include "storage/smgr.h"
#include "access/htup.h"
#include "access/xlogutils.h"
#include "catalog/pg_database.h"
#include "lib/hasht.h"
#include "storage/bufpage.h"
#include "storage/smgr.h"
#include "utils/relcache.h"
/*
* ---------------------------------------------------------------
*
......@@ -152,33 +149,6 @@ XLogIsValidTuple(RelFileNode hnode, ItemPointer iptr)
return (true);
}
/*
* Open pg_log in recovery
*/
extern Relation LogRelation; /* pg_log relation */
void
XLogOpenLogRelation(void)
{
Relation logRelation;
Assert(!LogRelation);
logRelation = (Relation) malloc(sizeof(RelationData));
memset(logRelation, 0, sizeof(RelationData));
logRelation->rd_rel = (Form_pg_class) malloc(sizeof(FormData_pg_class));
memset(logRelation->rd_rel, 0, sizeof(FormData_pg_class));
sprintf(RelationGetPhysicalRelationName(logRelation), "pg_log");
logRelation->rd_node.tblNode = InvalidOid;
logRelation->rd_node.relNode = RelOid_pg_log;
logRelation->rd_targblock = InvalidBlockNumber;
logRelation->rd_fd = -1;
logRelation->rd_fd = smgropen(DEFAULT_SMGR, logRelation, false);
if (logRelation->rd_fd < 0)
elog(STOP, "XLogOpenLogRelation: failed to open pg_log");
LogRelation = logRelation;
}
/*
* ---------------------------------------------------------------
*
......
......@@ -2,7 +2,7 @@
#
# Makefile for catalog
#
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.36 2001/08/24 14:07:48 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/catalog/Makefile,v 1.37 2001/08/25 18:52:41 tgl Exp $
#
#-------------------------------------------------------------------------
......@@ -31,7 +31,7 @@ POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\
pg_operator.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \
pg_language.h pg_largeobject.h pg_aggregate.h pg_statistic.h \
pg_rewrite.h pg_trigger.h pg_listener.h pg_description.h \
pg_database.h pg_shadow.h pg_group.h pg_log.h indexing.h \
pg_database.h pg_shadow.h pg_group.h indexing.h \
)
pg_includes := $(sort -I$(top_srcdir)/src/include -I$(top_builddir)/src/include)
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.174 2001/08/10 18:57:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.175 2001/08/25 18:52:41 tgl Exp $
*
*
* INTERFACE ROUTINES
......@@ -252,11 +252,6 @@ heap_create(char *relname,
tblNode = InvalidOid;
relid = RelOid_pg_database;
}
else if (strcmp(LogRelationName, relname) == 0)
{
tblNode = InvalidOid;
relid = RelOid_pg_log;
}
else
{
relid = newoid();
......
......@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.247 2001/08/21 16:36:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.248 2001/08/25 18:52:41 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
......@@ -51,7 +51,6 @@
#include <ctype.h>
#include "access/htup.h"
#include "catalog/catname.h"
#include "catalog/pg_type.h"
#include "nodes/params.h"
#include "nodes/parsenodes.h"
......@@ -5423,11 +5422,7 @@ relation_name: SpecialRuleRelation
}
| ColId
{
/* disallow refs to variable system tables */
if (strcmp(LogRelationName, $1) == 0)
elog(ERROR,"%s cannot be accessed by users",$1);
else
$$ = $1;
$$ = $1;
}
;
......
$Header: /cvsroot/pgsql/src/backend/storage/buffer/README,v 1.1 2001/07/06 21:04:25 tgl Exp $
$Header: /cvsroot/pgsql/src/backend/storage/buffer/README,v 1.2 2001/08/25 18:52:42 tgl Exp $
Notes about shared buffer access rules
--------------------------------------
......@@ -66,7 +66,7 @@ at about the same time would OR the same bits into the field, so there
is little or no risk of conflicting update; what's more, if there did
manage to be a conflict it would merely mean that one bit-update would
be lost and need to be done again later. These four bits are only hints
(they cache the results of transaction status lookups in pg_log), so no
(they cache the results of transaction status lookups in pg_clog), so no
great harm is done if they get reset to zero by conflicting updates.
5. To physically remove a tuple or compact free space on a page, one
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.41 2001/06/27 23:31:39 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.42 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -17,6 +17,7 @@
#include <sys/types.h>
#include "miscadmin.h"
#include "access/clog.h"
#include "access/xlog.h"
#include "storage/bufmgr.h"
#include "storage/freespace.h"
......@@ -51,6 +52,7 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends)
size = BufferShmemSize();
size += LockShmemSize(maxBackends);
size += XLOGShmemSize();
size += CLOGShmemSize();
size += SLockShmemSize();
size += SInvalShmemSize(maxBackends);
size += FreeSpaceShmemSize();
......@@ -80,9 +82,10 @@ CreateSharedMemoryAndSemaphores(bool makePrivate, int maxBackends)
InitShmemAllocation(seghdr);
/*
* Set up xlog and buffers
* Set up xlog, clog, and buffers
*/
XLOGShmemInit();
CLOGShmemInit();
InitBufferPool();
/*
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.38 2001/08/23 23:06:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.39 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -327,7 +327,7 @@ GetSnapshotData(bool serializable)
*--------------------
*/
ReadNewTransactionId(&(snapshot->xmax));
snapshot->xmax = ReadNewTransactionId();
for (index = 0; index < segP->lastBackend; index++)
{
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.49 2001/07/09 22:18:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lmgr.c,v 1.50 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -373,7 +373,7 @@ XactLockTableWait(TransactionId xid)
/*
* Transaction was committed/aborted/crashed - we have to update
* pg_log if transaction is still marked as running.
* pg_clog if transaction is still marked as running.
*/
if (!TransactionIdDidCommit(xid) && !TransactionIdDidAbort(xid))
TransactionIdAbort(xid);
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.142 2001/08/10 18:57:37 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.143 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -43,7 +43,6 @@
#include "catalog/indexing.h"
#include "catalog/pg_attrdef.h"
#include "catalog/pg_index.h"
#include "catalog/pg_log.h"
#include "catalog/pg_proc.h"
#include "catalog/pg_relcheck.h"
#include "catalog/pg_rewrite.h"
......@@ -67,7 +66,6 @@ static FormData_pg_attribute Desc_pg_class[Natts_pg_class] = {Schema_pg_class};
static FormData_pg_attribute Desc_pg_attribute[Natts_pg_attribute] = {Schema_pg_attribute};
static FormData_pg_attribute Desc_pg_proc[Natts_pg_proc] = {Schema_pg_proc};
static FormData_pg_attribute Desc_pg_type[Natts_pg_type] = {Schema_pg_type};
static FormData_pg_attribute Desc_pg_log[Natts_pg_log] = {Schema_pg_log};
/*
* Hash tables that index the relation cache
......@@ -2120,7 +2118,6 @@ RelationCacheInitialize(void)
formrdesc(AttributeRelationName, Natts_pg_attribute, Desc_pg_attribute);
formrdesc(ProcedureRelationName, Natts_pg_proc, Desc_pg_proc);
formrdesc(TypeRelationName, Natts_pg_type, Desc_pg_type);
formrdesc(LogRelationName, Natts_pg_log, Desc_pg_log);
/*
* init_irels() used to be called here. It is changed to be called in
......@@ -2167,10 +2164,6 @@ RelationCacheInitializePhase2(void)
fixrdesc(AttributeRelationName);
fixrdesc(ProcedureRelationName);
fixrdesc(TypeRelationName);
/*
* We don't bother to update the entries for pg_log.
*/
}
}
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.58 2001/06/12 05:55:50 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.59 2001/08/25 18:52:42 tgl Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
......@@ -102,7 +102,6 @@ char *SharedSystemRelationNames[] = {
GroupRelationName,
GroupNameIndex,
GroupSysidIndex,
LogRelationName,
ShadowRelationName,
ShadowNameIndex,
ShadowSysidIndex,
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.87 2001/06/16 22:58:16 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.88 2001/08/25 18:52:42 tgl Exp $
*
*
*-------------------------------------------------------------------------
......@@ -285,26 +285,15 @@ InitPostgres(const char *dbname, const char *username)
elog(FATAL, "InitPostgres: bad backend id %d", MyBackendId);
/*
* Initialize the transaction system and the relation descriptor
* cache. Note we have to make certain the lock manager is off while
* we do this.
* Initialize the transaction system override state.
*/
AmiTransactionOverride(IsBootstrapProcessingMode());
LockDisable(true);
AmiTransactionOverride(bootstrap);
/*
* Part of the initialization processing done here sets a read lock on
* pg_log. Since locking is disabled the set doesn't have intended
* effect of locking out writers, but this is ok, since we only lock
* it to examine AMI transaction status, and this is never written
* after initdb is done. -mer 15 June 1992
* Initialize the relation descriptor cache.
* The pre-allocated reldescs are created here.
*/
RelationCacheInitialize(); /* pre-allocated reldescs created here */
InitializeTransactionSystem(); /* pg_log,etc init/crash recovery
* here */
LockDisable(false);
RelationCacheInitialize();
/*
* Initialize the access methods. Does not touch files (?) - thomas
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.47 2001/05/30 20:52:34 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.48 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -193,7 +193,7 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
* happens right here. We cannot really determine if the
* tuple is valid without checking transaction commit status,
* and the only way to do that at init time is to paw over
* pg_log by hand, too. Instead of checking, we assume that
* pg_clog by hand, too. Instead of checking, we assume that
* the inserting transaction committed, and that any deleting
* transaction did also, unless shown otherwise by on-row
* commit status bits.
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.40 2001/08/23 23:06:38 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.41 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -611,12 +611,12 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId XmaxRecent)
* If the inserting transaction aborted, then the tuple was never visible
* to any other transaction, so we can delete it immediately.
*
* NOTE: must check TransactionIdIsInProgress (which looks in shared mem)
* NOTE: must check TransactionIdIsInProgress (which looks in PROC array)
* before TransactionIdDidCommit/TransactionIdDidAbort (which look in
* pg_log). Otherwise we have a race condition where we might decide
* pg_clog). Otherwise we have a race condition where we might decide
* that a just-committed transaction crashed, because none of the tests
* succeed. xact.c is careful to record commit/abort in pg_log before
* it unsets MyProc->xid in shared memory.
* succeed. xact.c is careful to record commit/abort in pg_clog before
* it unsets MyProc->xid in PROC array.
*/
if (!(tuple->t_infomask & HEAP_XMIN_COMMITTED))
{
......
......@@ -27,7 +27,7 @@
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.133 2001/08/25 00:31:17 petere Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.134 2001/08/25 18:52:42 tgl Exp $
#
#-------------------------------------------------------------------------
......@@ -440,6 +440,12 @@ else
mkdir "$PGDATA"/pg_xlog || exit_nicely
echo "ok"
fi
if [ ! -d "$PGDATA"/pg_clog ]
then
$ECHO_N "creating directory $PGDATA/pg_clog... "$ECHO_C
mkdir "$PGDATA"/pg_clog || exit_nicely
echo "ok"
fi
fi
......
......@@ -3,7 +3,7 @@
# pg_upgrade: update a database without needing a full dump/reload cycle.
# CAUTION: read the manual page before trying to use this!
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.16 2000/12/18 16:30:07 momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.17 2001/08/25 18:52:42 tgl Exp $
#
# NOTE: we must be sure to update the version-checking code a few dozen lines
# below for each new PostgreSQL release.
......@@ -127,9 +127,9 @@ fi
echo "Input script $INPUT complete, fixing row commit statuses..."
# Now vacuum each result database to mark all system-table rows as committed,
# because when pg_log is replaced with the saved version, the transaction
# because when pg_clog is replaced with the saved version, the transaction
# statuses will no longer match the data. VACUUM will force the on-row
# status flags to the right value so that pg_log will not matter anymore.
# status flags to the right value so that pg_clog will not matter anymore.
# Note: we used to try to do this as part of the previous step, but that
# risks permissions problems if VACUUM is run as the wrong user.
# Note: the initial VACUUM does template1, then we do everything else.
......@@ -171,7 +171,7 @@ do
fi
done
mv -f $OLDDIR/pg_log data
mv -f $OLDDIR/pg_clog data
mv -f $OLDDIR/pg_variable data
echo "You must stop/start the postmaster before doing anything else."
......
/*
* clog.h
*
* PostgreSQL transaction-commit-log manager
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: clog.h,v 1.1 2001/08/25 18:52:42 tgl Exp $
*/
#ifndef CLOG_H
#define CLOG_H
#include "access/xlog.h"
/*
* Possible transaction statuses --- note that all-zeroes is the initial
* state.
*/
typedef int XidStatus;
#define TRANSACTION_STATUS_IN_PROGRESS 0x00
#define TRANSACTION_STATUS_COMMITTED 0x01
#define TRANSACTION_STATUS_ABORTED 0x02
/* 0x03 is available without changing commit log space allocation */
extern void TransactionIdSetStatus(TransactionId xid, XidStatus status);
extern XidStatus TransactionIdGetStatus(TransactionId xid);
extern int CLOGShmemSize(void);
extern void CLOGShmemInit(void);
extern void BootStrapCLOG(void);
extern void StartupCLOG(void);
extern void ShutdownCLOG(void);
extern void CheckPointCLOG(void);
extern void ExtendCLOG(TransactionId newestXact);
extern void TruncateCLOG(TransactionId oldestXact);
/* XLOG stuff */
#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 */
/*
*
* rmgr.h
*
* Resource managers definition
*
* $Id: rmgr.h,v 1.6 2001/08/25 18:52:42 tgl Exp $
*/
#ifndef RMGR_H
#define RMGR_H
......@@ -16,6 +16,7 @@ typedef uint8 RmgrId;
#define RM_XLOG_ID 0
#define RM_XACT_ID 1
#define RM_SMGR_ID 2
#define RM_CLOG_ID 3
#define RM_HEAP_ID 10
#define RM_BTREE_ID 11
#define RM_HASH_ID 12
......
......@@ -7,33 +7,30 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: transam.h,v 1.38 2001/08/23 23:06:38 tgl Exp $
* $Id: transam.h,v 1.39 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef TRANSAM_H
#define TRANSAM_H
#include "storage/bufmgr.h"
#include "storage/spin.h"
/* ----------------
* Special transaction ID values
*
* We do not use any transaction IDs less than 512 --- this leaves the first
* 128 bytes of pg_log available for special purposes such as version number
* storage. (Currently, we do not actually use them for anything.)
*
* BootstrapTransactionId is the XID for "bootstrap" operations. It should
* BootstrapTransactionId is the XID for "bootstrap" operations, and
* FrozenTransactionId is used for very old tuples. Both should
* always be considered valid.
*
* FirstNormalTransactionId is the first "normal" transaction id.
* ----------------
*/
#define InvalidTransactionId ((TransactionId) 0)
#define DisabledTransactionId ((TransactionId) 1)
#define BootstrapTransactionId ((TransactionId) 512)
#define FirstNormalTransactionId ((TransactionId) 514)
#define BootstrapTransactionId ((TransactionId) 1)
#define FrozenTransactionId ((TransactionId) 2)
#define FirstNormalTransactionId ((TransactionId) 3)
/* ----------------
* transaction ID manipulation macros
......@@ -56,19 +53,6 @@
(dest) = FirstNormalTransactionId; \
} while(0)
/* ----------------
* transaction status values
*
* someday we will use "11" = 3 = XID_COMMIT_CHILD to mean the
* commiting of child xactions.
* ----------------
*/
#define XID_INPROGRESS 0 /* transaction in progress */
#define XID_ABORT 1 /* transaction aborted */
#define XID_COMMIT 2 /* transaction commited */
#define XID_COMMIT_CHILD 3 /* child xact commited */
typedef unsigned char XidStatus; /* (2 bits) */
/* ----------
* Object ID (OID) zero is InvalidOid.
......@@ -116,25 +100,15 @@ typedef VariableCacheData *VariableCache;
/*
* prototypes for functions in transam/transam.c
*/
extern void InitializeTransactionLog(void);
extern void AmiTransactionOverride(bool flag);
extern bool TransactionIdDidCommit(TransactionId transactionId);
extern bool TransactionIdDidAbort(TransactionId transactionId);
extern void TransactionIdCommit(TransactionId transactionId);
extern void TransactionIdAbort(TransactionId transactionId);
/* in transam/transsup.c */
extern void AmiTransactionOverride(bool flag);
extern void TransComputeBlockNumber(Relation relation,
TransactionId transactionId, BlockNumber *blockNumberOutP);
extern XidStatus TransBlockNumberGetXidStatus(Relation relation,
BlockNumber blockNumber, TransactionId xid, bool *failP);
extern void TransBlockNumberSetXidStatus(Relation relation,
BlockNumber blockNumber, TransactionId xid, XidStatus xstatus,
bool *failP);
/* in transam/varsup.c */
extern void GetNewTransactionId(TransactionId *xid);
extern void ReadNewTransactionId(TransactionId *xid);
extern TransactionId GetNewTransactionId(void);
extern TransactionId ReadNewTransactionId(void);
extern Oid GetNewObjectId(void);
extern void CheckMaxObjectId(Oid assigned_oid);
......@@ -143,9 +117,6 @@ extern void CheckMaxObjectId(Oid assigned_oid);
* ----------------
*/
/* in transam.c */
extern Relation LogRelation;
/* in xact.c */
extern bool AMI_OVERRIDE;
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xact.h,v 1.34 2001/07/12 04:11:13 tgl Exp $
* $Id: xact.h,v 1.35 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -54,7 +54,6 @@ typedef TransactionStateData *TransactionState;
#define TRANS_INPROGRESS 2
#define TRANS_COMMIT 3
#define TRANS_ABORT 4
#define TRANS_DISABLED 5
/* ----------------
* transaction block states
......@@ -100,7 +99,6 @@ extern int TransactionFlushEnabled(void);
extern void SetTransactionFlushEnabled(bool state);
extern bool IsAbortedTransactionBlockState(void);
extern void OverrideTransactionSystem(bool flag);
extern TransactionId GetCurrentTransactionId(void);
extern CommandId GetCurrentCommandId(void);
extern CommandId GetScanCommandId(void);
......@@ -110,7 +108,6 @@ extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
extern bool CommandIdIsCurrentCommandId(CommandId cid);
extern bool CommandIdGEScanCommandId(CommandId cid);
extern void CommandCounterIncrement(void);
extern void InitializeTransactionSystem(void);
extern void StartTransactionCommand(void);
extern void CommitTransactionCommand(void);
extern void AbortCurrentTransaction(void);
......
......@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xlog.h,v 1.24 2001/07/19 02:12:35 tgl Exp $
* $Id: xlog.h,v 1.25 2001/08/25 18:52:42 tgl Exp $
*/
#ifndef XLOG_H
#define XLOG_H
......@@ -14,6 +14,7 @@
#include "access/rmgr.h"
#include "access/transam.h"
#include "access/xlogdefs.h"
#include "storage/bufmgr.h"
#include "utils/pg_crc.h"
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xlogdefs.h,v 1.3 2001/03/22 04:00:32 momjian Exp $
* $Id: xlogdefs.h,v 1.4 2001/08/25 18:52:42 tgl Exp $
*/
#ifndef XLOG_DEFS_H
#define XLOG_DEFS_H
......@@ -52,7 +52,7 @@ typedef struct XLogRecPtr
/*
* StartUpID (SUI) - system startups counter. It's to allow removing
* pg_log after shutdown, in future.
* pg_clog after shutdown, in future.
*/
typedef uint32 StartUpID;
......
......@@ -6,20 +6,20 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xlogutils.h,v 1.7 2001/03/22 04:00:32 momjian Exp $
* $Id: xlogutils.h,v 1.8 2001/08/25 18:52:42 tgl Exp $
*/
#ifndef XLOG_UTILS_H
#define XLOG_UTILS_H
#include "access/rmgr.h"
#include "storage/buf.h"
#include "storage/itemptr.h"
#include "utils/rel.h"
extern int XLogIsOwnerOfTuple(RelFileNode hnode, ItemPointer iptr,
TransactionId xid, CommandId cid);
extern bool XLogIsValidTuple(RelFileNode hnode, ItemPointer iptr);
extern void XLogOpenLogRelation(void);
extern void XLogInitRelationCache(void);
extern void XLogCloseRelationCache(void);
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: catname.h,v 1.19 2001/05/14 20:30:21 momjian Exp $
* $Id: catname.h,v 1.20 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -29,7 +29,6 @@
#define LanguageRelationName "pg_language"
#define LargeObjectRelationName "pg_largeobject"
#define ListenerRelationName "pg_listener"
#define LogRelationName "pg_log"
#define OperatorClassRelationName "pg_opclass"
#define OperatorRelationName "pg_operator"
#define ProcedureRelationName "pg_proc"
......
......@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: catversion.h,v 1.91 2001/08/21 16:36:05 tgl Exp $
* $Id: catversion.h,v 1.92 2001/08/25 18:52:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
#define CATALOG_VERSION_NO 200108211
#define CATALOG_VERSION_NO 200108241
#endif
......@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_attribute.h,v 1.74 2001/08/10 18:57:40 tgl Exp $
* $Id: pg_attribute.h,v 1.75 2001/08/25 18:52:42 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -474,25 +474,13 @@ DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i f f));
DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i f f));
/* ----------------
* pg_log - this relation is modified by special purpose access
* method code. The following is garbage but is needed
* so that the reldesc code works properly.
* pg_xactlock - this is not a real relation, but is a placeholder
* to allow a relation OID to be used for transaction
* waits. We need a pg_xactlock entry in pg_class only to
* ensure that that OID can never be allocated to a real
* table; and this entry is just to link to that one.
* ----------------
*/
#define Schema_pg_log \
{ 1269, {"logfoo"}, 26, 0, 4, 1, 0, -1, -1, true, 'p', false, 'i', false, false }
DATA(insert ( 1269 logfoo 26 0 4 1 0 -1 -1 t p f i f f));
/* ----------------
* pg_xactlock - this relation is modified by special purpose access
* method code. The following is garbage but is needed
* so that the reldesc code works properly.
* ----------------
*/
#define Schema_pg_xactlock \
{ 376, {"xactlockfoo"}, 26, 0, 4, 1, 0, -1, -1, true, 'p', false, 'i', false, false }
DATA(insert ( 376 xactlockfoo 26 0 4 1 0 -1 -1 t p f i f f));
#endif /* PG_ATTRIBUTE_H */
......@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.52 2001/08/10 18:57:40 tgl Exp $
* $Id: pg_class.h,v 1.53 2001/08/25 18:52:43 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -144,8 +144,6 @@ DATA(insert OID = 1261 ( pg_group 87 PGUID 0 1261 0 0 0 0 f t r 3 0 0 0 0 0 f
DESCR("");
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 1262 0 0 0 0 f t r 7 0 0 0 0 0 t f f f _null_ ));
DESCR("");
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 1269 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ ));
DESCR("");
DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 0 0 0 f t s 1 0 0 0 0 0 f f f f _null_ ));
DESCR("");
......@@ -156,7 +154,6 @@ DESCR("");
#define RelOid_pg_shadow 1260
#define RelOid_pg_group 1261
#define RelOid_pg_database 1262
#define RelOid_pg_log 1269
/* Xact lock pseudo-table */
#define XactLockTableId 376
......
/*-------------------------------------------------------------------------
*
* pg_log.h
* the system log relation "pg_log" is not a "heap" relation.
* it is automatically created by the transam/ code and the
* information here is all bogus and is just here to make the
* relcache code happy.
*
*
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_log.h,v 1.9 2001/08/10 18:57:40 tgl Exp $
*
* NOTES
* The structures and macros used by the transam/ code
* to access pg_log should some day go here -cim 6/18/90
*
*-------------------------------------------------------------------------
*/
#ifndef PG_LOG_H
#define PG_LOG_H
/* ----------------
* postgres.h contains the system type definintions and the
* CATALOG(), BOOTSTRAP and DATA() sugar words so this file
* can be read by both genbki.sh and the C compiler.
* ----------------
*/
CATALOG(pg_log) BOOTSTRAP BKI_WITHOUT_OIDS
{
Oid logfoo;
} FormData_pg_log;
typedef FormData_pg_log *Form_pg_log;
#define Natts_pg_log 1
#define Anum_pg_log_logfoo 1
#endif /* PG_LOG_H */
......@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.109 2001/06/12 05:55:50 tgl Exp $
* $Id: pg_type.h,v 1.110 2001/08/25 18:52:43 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
......@@ -239,7 +239,6 @@ DATA(insert OID = 83 ( pg_class PGUID 4 4 t c t \054 1259 0 int4in int4out int4
DATA(insert OID = 86 ( pg_shadow PGUID 4 4 t c t \054 1260 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 87 ( pg_group PGUID 4 4 t c t \054 1261 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 88 ( pg_database PGUID 4 4 t c t \054 1262 0 int4in int4out int4in int4out i p _null_));
DATA(insert OID = 99 ( pg_log PGUID 4 4 t c t \054 1269 0 int4in int4out int4in int4out i p _null_));
/* OIDS 100 - 199 */
......
......@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: bufpage.h,v 1.42 2001/05/14 22:06:41 momjian Exp $
* $Id: bufpage.h,v 1.43 2001/08/25 18:52:43 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -54,10 +54,6 @@
* obviously, a page is not formatted before it is initialized with by
* a call to PageInit.
*
* The contents of the special pg_log tables are raw disk blocks with
* special formats. these are the only "access methods" that need not
* write disk pages.
*
* NOTES:
*
* linp1..N form an ItemId array. ItemPointers point into this array
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment