1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-29 22:49:41 +03:00
This commit is contained in:
Vadim B. Mikheev
2000-10-28 16:21:00 +00:00
parent 2f4c9d39fe
commit 5b0740d3fc
25 changed files with 2829 additions and 272 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: transam.h,v 1.24 2000/01/26 05:57:51 momjian Exp $
* $Id: transam.h,v 1.25 2000/10/28 16:20:59 vadim Exp $
*
* NOTES
* Transaction System Version 101 now support proper oid
@@ -67,7 +67,11 @@ typedef unsigned char XidStatus;/* (2 bits) */
* transaction page definitions
* ----------------
*/
#ifdef XLOG
#define TP_DataSize (BLCKSZ - sizeof(XLogRecPtr))
#else
#define TP_DataSize BLCKSZ
#endif
#define TP_NumXidStatusPerBlock (TP_DataSize * 4)
/* ----------------
@@ -84,6 +88,10 @@ typedef unsigned char XidStatus;/* (2 bits) */
*/
typedef struct LogRelationContentsData
{
#ifdef XLOG
XLogRecPtr LSN; /* temp hack: LSN is member of any block */
/* so should be described in bufmgr */
#endif
int TransSystemVersion;
} LogRelationContentsData;
@@ -107,6 +115,9 @@ typedef LogRelationContentsData *LogRelationContents;
*/
typedef struct VariableRelationContentsData
{
#ifdef XLOG
XLogRecPtr LSN;
#endif
int TransSystemVersion;
TransactionId nextXidData;
TransactionId lastXidData; /* unused */

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: xact.h,v 1.28 2000/10/20 11:01:14 vadim Exp $
* $Id: xact.h,v 1.29 2000/10/28 16:20:59 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -135,6 +135,8 @@ extern bool IsTransactionBlock(void);
extern void UserAbortTransactionBlock(void);
extern void AbortOutOfAnyTransaction(void);
extern void RecordTransactionCommit(void);
extern TransactionId DisabledTransactionId;
extern void XactPushRollback(void (*func) (void *), void* data);

View File

@@ -10,12 +10,7 @@
#include "access/rmgr.h"
#include "access/transam.h"
typedef struct XLogRecPtr
{
uint32 xlogid; /* log file #, 0 based */
uint32 xrecoff; /* offset of record in log file */
} XLogRecPtr;
#include "access/xlogdefs.h"
typedef struct XLogRecord
{
@@ -83,12 +78,7 @@ typedef XLogPageHeaderData *XLogPageHeader;
#define XLByteEQ(left, right) \
(right.xlogid == left.xlogid && right.xrecoff == left.xrecoff)
/*
* StartUpID (SUI) - system startups counter.
* It's to allow removing pg_log after shutdown.
*/
typedef uint32 StartUpID;
extern StartUpID ThisStartUpID;
extern StartUpID ThisStartUpID; /* current SUI */
extern bool InRecovery;
extern XLogRecPtr MyLastRecPtr;

View File

@@ -0,0 +1,24 @@
/*
*
* xlogdefs.h
*
* Postgres transaction log manager record pointer and
* system stratup number definitions
*
*/
#ifndef XLOG_DEFS_H
#define XLOG_DEFS_H
typedef struct XLogRecPtr
{
uint32 xlogid; /* log file #, 0 based */
uint32 xrecoff; /* offset of record in log file */
} XLogRecPtr;
/*
* StartUpID (SUI) - system startups counter. It's to allow removing
* pg_log after shutdown, in future.
*/
typedef uint32 StartUpID;
#endif /* XLOG_DEFS_H */

View File

@@ -9,8 +9,10 @@ extern bool XLogIsValidTuple(RelFileNode hnode, ItemPointer iptr);
extern void XLogOpenLogRelation(void);
extern Buffer XLogReadBuffer(bool extend, Relation reln, BlockNumber blkno);
extern void XLogInitRelationCache(void);
extern void XLogCloseRelationCache(void);
extern Relation XLogOpenRelation(bool redo, RmgrId rmid, RelFileNode rnode);
extern Buffer XLogReadBuffer(bool extend, Relation reln, BlockNumber blkno);
#endif