head	1.6;
access;
symbols
	Version_2_1:1.5
	Version_2:1.1;
locks; strict;
comment	@ * @;


1.6
date	92.05.28.20.26.30;	author mer;	state Exp;
branches;
next	1.5;

1.5
date	90.09.12.17.59.17;	author cimarron;	state Exp;
branches;
next	1.4;

1.4
date	90.08.18.00.40.04;	author cimarron;	state Exp;
branches;
next	1.3;

1.3
date	90.08.17.08.51.12;	author cimarron;	state Exp;
branches;
next	1.2;

1.2
date	90.08.08.08.15.20;	author cimarron;	state Exp;
branches;
next	1.1;

1.1
date	90.03.31.18.59.59;	author cimarron;	state Version_2;
branches;
next	;


desc
@@


1.6
log
@type TransactionIdData no long exists
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	transam.h
 *	
 *   DESCRIPTION
 *	postgres transaction access method support code header
 *
 *   NOTES
 *	Transaction System Version 101 now support proper oid
 *	generation and recording in the variable relation.
 *
 *   IDENTIFICATION
 *	$Header: /private/mer/pg.latest/src/lib/H/access/RCS/transam.h,v 1.5 1990/09/12 17:59:17 cimarron Exp mer $
 * ----------------------------------------------------------------
 */

#ifndef TransamIncluded       /* include this file only once */
#define TransamIncluded 1

/* ----------------
 *	transaction system version id
 *
 *	this is stored on the first page of the log, time and variable
 *	relations on the first 4 bytes.  This is so that if we improve
 *	the format of the transaction log after postgres version 2, then
 *	people won't have to rebuild their databases.
 *
 *	TRANS_SYSTEM_VERSION 100 means major version 1 minor version 0.
 *	Two databases with the same major version should be compatible,
 *	even if their minor versions differ.
 * ----------------
 */
#define TRANS_SYSTEM_VERSION	101

/* ----------------
 *	transaction id status values
 *
 *	someday we will use "11" = 3 = XID_INVALID to mean the
 *	starting of run-length encoded log data.
 * ----------------
 */
#define XID_COMMIT      2       		/* transaction commited */
#define XID_ABORT       1       		/* transaction aborted */
#define XID_INPROGRESS  0       		/* transaction in progress */
#define XID_INVALID     3       		/* other */

typedef unsigned char XidStatus; 		/* (2 bits) */

/* ----------------
 *   	BitIndexOf computes the index of the Nth xid on a given block
 * ----------------
 */
#define BitIndexOf(N)   ((N) * 2)

/* ----------------
 *	transaction page definitions
 * ----------------
 */
#define TP_DataSize		BLCKSZ
#define TP_NumXidStatusPerBlock	(TP_DataSize * 4)
#define TP_NumTimePerBlock	(TP_DataSize / 4)

/* ----------------
 *	LogRelationContents structure
 *
 *	This structure describes the storage of the data in the
 *	first 128 bytes of the log relation.  This storage is never
 *	used for transaction status because transaction id's begin
 *	their numbering at 512.
 *
 *	The first 4 bytes of this relation store the version
 *	number of the transction system.
 * ----------------
 */
typedef struct LogRelationContentsData {
   int			TransSystemVersion;
} LogRelationContentsData;

typedef LogRelationContentsData *LogRelationContents;

/* ----------------
 *	TimeRelationContents structure
 *
 *	This structure describes the storage of the data in the
 *	first 2048 bytes of the time relation.  This storage is never
 *	used for transaction commit times because transaction id's begin
 *	their numbering at 512.
 *
 *	The first 4 bytes of this relation store the version
 *	number of the transction system.
 * ----------------
 */
typedef struct TimeRelationContentsData {
   int			TransSystemVersion;
} TimeRelationContentsData;

typedef TimeRelationContentsData *TimeRelationContents;

/* ----------------
 *	VariableRelationContents structure
 *
 *	The variable relation is a special "relation" which
 *	is used to store various system "variables" persistantly.
 *	Unlike other relations in the system, this relation
 *	is updated in place whenever the variables change.
 *
 *	The first 4 bytes of this relation store the version
 *	number of the transction system.
 *
 *	Currently, the relation has only one page and the next
 *	available xid, the last committed xid and the next
 *	available oid are stored there.
 * ----------------
 */
typedef struct VariableRelationContentsData {
   int			TransSystemVersion;
   TransactionId	nextXidData;
   TransactionId	lastXidData;
   oid			nextOid;
} VariableRelationContentsData;

typedef VariableRelationContentsData *VariableRelationContents;

/* ----------------
 *	extern declarations
 * ----------------
 */
  
/* ----------------
 *	global variable extern declarations
 * ----------------
 */
extern Relation	LogRelation;
extern Relation	TimeRelation;
extern Relation	VariableRelation;

extern bool AMI_OVERRIDE;

#endif TramsamIncluded
@


1.5
log
@simplified header files, added the nextOid field to the variable
relation contents structure, incremented the transaction system
version number.
@
text
@d13 1
a13 1
 *	$Header: RCS/transam.h,v 1.4 90/08/18 00:40:04 cimarron Exp Locker: cimarron $
d117 2
a118 2
   TransactionIdData	nextXidData;
   TransactionIdData	lastXidData;
@


1.4
log
@eliminated less significant .h files
@
text
@d9 3
a11 1
 *	
d13 1
a13 1
 *	$Header: RCS/transam.h,v 1.3 90/08/17 08:51:12 cimarron Exp Locker: cimarron $
a19 25
#include <sys/file.h>
#include <strings.h>
#include <math.h>
#include <stdio.h>

#include "tmp/postgres.h"	/* for struct varlena, etc. */

#include "access/att.h"
#include "access/attnum.h"
#include "access/heapam.h"
#include "access/htup.h"
#include "access/relscan.h"
#include "access/skey.h"
#include "access/tupdesc.h"
#include "catalog/catname.h"
#include "rules/rlock.h"
#include "storage/block.h"
#include "storage/buf.h"
#include "storage/bufmgr.h"
#include "storage/bufpage.h"
#include "utils/memutils.h"
#include "utils/log.h"
#include "utils/mcxt.h"
#include "utils/rel.h"

d33 1
a33 1
#define TRANS_SYSTEM_VERSION	100
d111 2
a112 1
 *	available xid and the last committed xid are stored there.
d119 1
@


1.3
log
@added pathnames to #include statements
@
text
@d11 1
a11 1
 *	$Header: RCS/transam.h,v 1.2 90/08/08 08:15:20 cimarron Exp Locker: cimarron $
d27 7
a33 1
#include "tmp/bit.h"
d38 1
a38 4
#include "catalog/catname.h"
#include "tmp/datum.h"
#include "access/heapam.h"
#include "access/htup.h"
a40 1
#include "tmp/name.h"
a41 5
#include "access/relscan.h"
#include "rules/rlock.h"
#include "access/skey.h"
#include "access/tupdesc.h"
#include "tmp/xid.h"
@


1.2
log
@reorganized some header files
@
text
@d11 1
a11 1
 *	$Header: RCS/transam.h,v 1.1 90/03/31 18:59:59 cimarron Version_2 Locker: cimarron $
a17 4
/* ----------------
 *	Include files (XXX clean these up!)
 * ----------------
 */
d23 1
a23 1
#include "postgres.h"	/* for struct varlena, etc. */
d25 20
a44 20
#include "att.h"
#include "attnum.h"
#include "bit.h"
#include "block.h"
#include "buf.h"
#include "bufmgr.h"
#include "bufpage.h"
#include "catname.h"
#include "datum.h"
#include "heapam.h"
#include "htup.h"
#include "log.h"
#include "mcxt.h"
#include "name.h"
#include "rel.h"
#include "relscan.h"
#include "rlock.h"
#include "skey.h"
#include "tupdesc.h"
#include "xid.h"
@


1.1
log
@Initial revision
@
text
@d11 1
a11 1
 *	$Header$
a27 1
#include "c.h"
a28 1
#include "anum.h"
a35 1
#include "cat.h"
a42 1
#include "oid.h"
a45 1
#include "rproc.h"
@
