mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	Massive commit to run PGINDENT on all *.c and *.h files.
This commit is contained in:
		@@ -1,60 +1,60 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * attnum.h--
 | 
			
		||||
 *    POSTGRES attribute number definitions.
 | 
			
		||||
 *	  POSTGRES attribute number definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: attnum.h,v 1.4 1996/10/31 09:46:35 scrappy Exp $
 | 
			
		||||
 * $Id: attnum.h,v 1.5 1997/09/07 04:55:45 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	ATTNUM_H
 | 
			
		||||
#ifndef ATTNUM_H
 | 
			
		||||
#define ATTNUM_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * user defined attribute numbers start at 1.	-ay 2/95
 | 
			
		||||
 */
 | 
			
		||||
typedef int16		AttrNumber;
 | 
			
		||||
typedef int16	AttrNumber;
 | 
			
		||||
 | 
			
		||||
#define InvalidAttrNumber	0
 | 
			
		||||
#define InvalidAttrNumber		0
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	support macros
 | 
			
		||||
 *		support macros
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
/*
 | 
			
		||||
 * AttributeNumberIsValid --
 | 
			
		||||
 *	True iff the attribute number is valid.
 | 
			
		||||
 *		True iff the attribute number is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define AttributeNumberIsValid(attributeNumber) \
 | 
			
		||||
    ((bool) ((attributeNumber) != InvalidAttrNumber))
 | 
			
		||||
	((bool) ((attributeNumber) != InvalidAttrNumber))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * AttrNumberIsForUserDefinedAttr --
 | 
			
		||||
 *	True iff the attribute number corresponds to an user defined attribute.
 | 
			
		||||
 *		True iff the attribute number corresponds to an user defined attribute.
 | 
			
		||||
 */
 | 
			
		||||
#define AttrNumberIsForUserDefinedAttr(attributeNumber) \
 | 
			
		||||
    ((bool) ((attributeNumber) > 0))
 | 
			
		||||
	((bool) ((attributeNumber) > 0))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * AttrNumberGetAttrOffset --
 | 
			
		||||
 *	Returns the attribute offset for an attribute number.
 | 
			
		||||
 *		Returns the attribute offset for an attribute number.
 | 
			
		||||
 *
 | 
			
		||||
 * Note:
 | 
			
		||||
 *	Assumes the attribute number is for an user defined attribute.
 | 
			
		||||
 *		Assumes the attribute number is for an user defined attribute.
 | 
			
		||||
 */
 | 
			
		||||
#define AttrNumberGetAttrOffset(attNum) \
 | 
			
		||||
     (AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)) ? \
 | 
			
		||||
      ((attNum - 1)) : 0)
 | 
			
		||||
	 (AssertMacro(AttrNumberIsForUserDefinedAttr(attNum)) ? \
 | 
			
		||||
	  ((attNum - 1)) : 0)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * AttributeOffsetGetAttributeNumber --
 | 
			
		||||
 *	Returns the attribute number for an attribute offset.
 | 
			
		||||
 *		Returns the attribute number for an attribute offset.
 | 
			
		||||
 */
 | 
			
		||||
#define AttrOffsetGetAttrNumber(attributeOffset) \
 | 
			
		||||
     ((AttrNumber) (1 + attributeOffset))
 | 
			
		||||
	 ((AttrNumber) (1 + attributeOffset))
 | 
			
		||||
 | 
			
		||||
#endif /* ATTNUM_H */
 | 
			
		||||
#endif							/* ATTNUM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +1,27 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * funcindex.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: funcindex.h,v 1.2 1996/08/28 01:56:16 scrappy Exp $
 | 
			
		||||
 * $Id: funcindex.h,v 1.3 1997/09/07 04:55:47 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef _FUNC_INDEX_INCLUDED_
 | 
			
		||||
#define _FUNC_INDEX_INCLUDED_
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
	int	nargs;
 | 
			
		||||
	Oid	arglist[8];
 | 
			
		||||
	Oid	procOid;
 | 
			
		||||
	NameData funcName;
 | 
			
		||||
} FuncIndexInfo;
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
	int				nargs;
 | 
			
		||||
	Oid				arglist[8];
 | 
			
		||||
	Oid				procOid;
 | 
			
		||||
	NameData		funcName;
 | 
			
		||||
}				FuncIndexInfo;
 | 
			
		||||
 | 
			
		||||
typedef FuncIndexInfo	*FuncIndexInfoPtr;
 | 
			
		||||
typedef FuncIndexInfo *FuncIndexInfoPtr;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * some marginally useful macro definitions
 | 
			
		||||
@@ -38,4 +39,4 @@ typedef FuncIndexInfo	*FuncIndexInfoPtr;
 | 
			
		||||
 | 
			
		||||
#define FIisFunctionalIndex(FINFO) (FINFO->procOid != InvalidOid)
 | 
			
		||||
 | 
			
		||||
#endif /* FUNCINDEX_H */
 | 
			
		||||
#endif							/* FUNCINDEX_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * genam.h--
 | 
			
		||||
 *    POSTGRES general access method definitions.
 | 
			
		||||
 *	  POSTGRES general access method definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: genam.h,v 1.7 1997/08/19 21:37:13 momjian Exp $
 | 
			
		||||
 * $Id: genam.h,v 1.8 1997/09/07 04:55:48 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	GENAM_H
 | 
			
		||||
#ifndef GENAM_H
 | 
			
		||||
#define GENAM_H
 | 
			
		||||
 | 
			
		||||
#include <access/sdir.h>
 | 
			
		||||
@@ -19,33 +19,39 @@
 | 
			
		||||
#include <access/itup.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	generalized index_ interface routines
 | 
			
		||||
 *		generalized index_ interface routines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
extern Relation index_open(Oid relationId);
 | 
			
		||||
extern Relation index_openr(char *relationName);
 | 
			
		||||
extern void index_close(Relation relation);
 | 
			
		||||
extern InsertIndexResult index_insert(Relation relation,
 | 
			
		||||
				      Datum *datum, char *nulls,
 | 
			
		||||
				      ItemPointer heap_t_ctid,
 | 
			
		||||
				      Relation heapRel);
 | 
			
		||||
extern void index_delete(Relation relation, ItemPointer indexItem);
 | 
			
		||||
extern IndexScanDesc index_beginscan(Relation relation, bool scanFromEnd,
 | 
			
		||||
     uint16 numberOfKeys, ScanKey key);
 | 
			
		||||
extern void index_rescan(IndexScanDesc scan, bool scanFromEnd, ScanKey key);
 | 
			
		||||
extern void index_endscan(IndexScanDesc scan);
 | 
			
		||||
extern RetrieveIndexResult index_getnext(IndexScanDesc scan,
 | 
			
		||||
					 ScanDirection direction);
 | 
			
		||||
extern RegProcedure index_getprocid(Relation irel, AttrNumber attnum,
 | 
			
		||||
				    uint16 procnum);
 | 
			
		||||
extern Datum GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc,
 | 
			
		||||
     int attOff, AttrNumber attrNums[], FuncIndexInfo *fInfo,
 | 
			
		||||
     bool *attNull, Buffer buffer);
 | 
			
		||||
extern void		index_close(Relation relation);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
index_insert(Relation relation,
 | 
			
		||||
			 Datum * datum, char *nulls,
 | 
			
		||||
			 ItemPointer heap_t_ctid,
 | 
			
		||||
			 Relation heapRel);
 | 
			
		||||
extern void		index_delete(Relation relation, ItemPointer indexItem);
 | 
			
		||||
extern IndexScanDesc
 | 
			
		||||
index_beginscan(Relation relation, bool scanFromEnd,
 | 
			
		||||
				uint16 numberOfKeys, ScanKey key);
 | 
			
		||||
extern void		index_rescan(IndexScanDesc scan, bool scanFromEnd, ScanKey key);
 | 
			
		||||
extern void		index_endscan(IndexScanDesc scan);
 | 
			
		||||
extern RetrieveIndexResult
 | 
			
		||||
index_getnext(IndexScanDesc scan,
 | 
			
		||||
			  ScanDirection direction);
 | 
			
		||||
extern RegProcedure
 | 
			
		||||
index_getprocid(Relation irel, AttrNumber attnum,
 | 
			
		||||
				uint16 procnum);
 | 
			
		||||
extern Datum
 | 
			
		||||
GetIndexValue(HeapTuple tuple, TupleDesc hTupDesc,
 | 
			
		||||
			  int attOff, AttrNumber attrNums[], FuncIndexInfo * fInfo,
 | 
			
		||||
			  bool * attNull, Buffer buffer);
 | 
			
		||||
 | 
			
		||||
/* in genam.c */
 | 
			
		||||
extern IndexScanDesc RelationGetIndexScan(Relation relation, bool scanFromEnd,
 | 
			
		||||
					  uint16 numberOfKeys, ScanKey key);
 | 
			
		||||
extern void IndexScanMarkPosition(IndexScanDesc scan);
 | 
			
		||||
extern void IndexScanRestorePosition(IndexScanDesc scan);
 | 
			
		||||
extern IndexScanDesc
 | 
			
		||||
RelationGetIndexScan(Relation relation, bool scanFromEnd,
 | 
			
		||||
					 uint16 numberOfKeys, ScanKey key);
 | 
			
		||||
extern void		IndexScanMarkPosition(IndexScanDesc scan);
 | 
			
		||||
extern void		IndexScanRestorePosition(IndexScanDesc scan);
 | 
			
		||||
 | 
			
		||||
#endif	/* GENAM_H */
 | 
			
		||||
#endif							/* GENAM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,11 +1,11 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * gist.h--
 | 
			
		||||
 *    common declarations for the GiST access method code.
 | 
			
		||||
 *	  common declarations for the GiST access method code.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * 
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,130 +21,136 @@
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
#include <storage/off.h>
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
** You can have as many strategies as you please in GiSTs, as
 | 
			
		||||
** long as your consistent method can handle them
 | 
			
		||||
**
 | 
			
		||||
** But strat.h->StrategyEvaluationData->StrategyExpression  expression[12]
 | 
			
		||||
** But strat.h->StrategyEvaluationData->StrategyExpression	expression[12]
 | 
			
		||||
** - so 12 is real max # of strategies, or StrategyEvaluationIsValid
 | 
			
		||||
** crashes backend...		- vadim 05/21/97
 | 
			
		||||
** crashes backend...			- vadim 05/21/97
 | 
			
		||||
 | 
			
		||||
#define GISTNStrategies			100
 | 
			
		||||
#define GISTNStrategies					100
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
#define GISTNStrategies			12
 | 
			
		||||
#define GISTNStrategies					12
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** Helper routines
 | 
			
		||||
*/
 | 
			
		||||
#define GISTNProcs			8
 | 
			
		||||
#define GIST_CONSISTENT_PROC		1
 | 
			
		||||
#define GIST_UNION_PROC			2
 | 
			
		||||
#define GIST_COMPRESS_PROC		3
 | 
			
		||||
#define GIST_DECOMPRESS_PROC		4
 | 
			
		||||
#define GIST_PENALTY_PROC		5
 | 
			
		||||
#define GIST_PICKSPLIT_PROC		6
 | 
			
		||||
#define GIST_EQUAL_PROC 		7
 | 
			
		||||
#define GIST_INFO_PROC			8
 | 
			
		||||
#define GISTNProcs						8
 | 
			
		||||
#define GIST_CONSISTENT_PROC			1
 | 
			
		||||
#define GIST_UNION_PROC					2
 | 
			
		||||
#define GIST_COMPRESS_PROC				3
 | 
			
		||||
#define GIST_DECOMPRESS_PROC			4
 | 
			
		||||
#define GIST_PENALTY_PROC				5
 | 
			
		||||
#define GIST_PICKSPLIT_PROC				6
 | 
			
		||||
#define GIST_EQUAL_PROC					7
 | 
			
		||||
#define GIST_INFO_PROC					8
 | 
			
		||||
 | 
			
		||||
#define F_LEAF		(1 << 0)
 | 
			
		||||
#define F_LEAF			(1 << 0)
 | 
			
		||||
 | 
			
		||||
typedef struct GISTPageOpaqueData {
 | 
			
		||||
	uint32		flags;
 | 
			
		||||
} GISTPageOpaqueData;
 | 
			
		||||
typedef struct GISTPageOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	uint32			flags;
 | 
			
		||||
}				GISTPageOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef GISTPageOpaqueData	*GISTPageOpaque;
 | 
			
		||||
typedef GISTPageOpaqueData *GISTPageOpaque;
 | 
			
		||||
 | 
			
		||||
#define GIST_LEAF(entry) (((GISTPageOpaque) PageGetSpecialPointer((entry)->page))->flags & F_LEAF)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When we descend a tree, we keep a stack of parent pointers.
 | 
			
		||||
 *	When we descend a tree, we keep a stack of parent pointers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct GISTSTACK {
 | 
			
		||||
typedef struct GISTSTACK
 | 
			
		||||
{
 | 
			
		||||
	struct GISTSTACK *gs_parent;
 | 
			
		||||
	OffsetNumber	gs_child;
 | 
			
		||||
	BlockNumber	gs_blk;
 | 
			
		||||
} GISTSTACK;
 | 
			
		||||
	BlockNumber		gs_blk;
 | 
			
		||||
}				GISTSTACK;
 | 
			
		||||
 | 
			
		||||
typedef struct GISTSTATE {
 | 
			
		||||
    func_ptr consistentFn;
 | 
			
		||||
    func_ptr unionFn;
 | 
			
		||||
    func_ptr compressFn;
 | 
			
		||||
    func_ptr decompressFn;
 | 
			
		||||
    func_ptr penaltyFn;
 | 
			
		||||
    func_ptr picksplitFn;
 | 
			
		||||
    func_ptr equalFn;
 | 
			
		||||
    bool     haskeytype;
 | 
			
		||||
    bool     keytypbyval;
 | 
			
		||||
} GISTSTATE;
 | 
			
		||||
typedef struct GISTSTATE
 | 
			
		||||
{
 | 
			
		||||
	func_ptr		consistentFn;
 | 
			
		||||
	func_ptr		unionFn;
 | 
			
		||||
	func_ptr		compressFn;
 | 
			
		||||
	func_ptr		decompressFn;
 | 
			
		||||
	func_ptr		penaltyFn;
 | 
			
		||||
	func_ptr		picksplitFn;
 | 
			
		||||
	func_ptr		equalFn;
 | 
			
		||||
	bool			haskeytype;
 | 
			
		||||
	bool			keytypbyval;
 | 
			
		||||
}				GISTSTATE;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
**  When we're doing a scan, we need to keep track of the parent stack
 | 
			
		||||
**  for the marked and current items.  
 | 
			
		||||
**	When we're doing a scan, we need to keep track of the parent stack
 | 
			
		||||
**	for the marked and current items.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
typedef struct GISTScanOpaqueData {
 | 
			
		||||
	struct GISTSTACK	*s_stack;
 | 
			
		||||
	struct GISTSTACK	*s_markstk;
 | 
			
		||||
	uint16		s_flags;
 | 
			
		||||
	struct GISTSTATE        *giststate;
 | 
			
		||||
} GISTScanOpaqueData;
 | 
			
		||||
typedef struct GISTScanOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	struct GISTSTACK *s_stack;
 | 
			
		||||
	struct GISTSTACK *s_markstk;
 | 
			
		||||
	uint16			s_flags;
 | 
			
		||||
	struct GISTSTATE *giststate;
 | 
			
		||||
}				GISTScanOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef GISTScanOpaqueData	*GISTScanOpaque;
 | 
			
		||||
typedef GISTScanOpaqueData *GISTScanOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
**  When we're doing a scan and updating a tree at the same time, the
 | 
			
		||||
**  updates may affect the scan.  We use the flags entry of the scan's
 | 
			
		||||
**  opaque space to record our actual position in response to updates
 | 
			
		||||
**  that we can't handle simply by adjusting pointers.
 | 
			
		||||
**	When we're doing a scan and updating a tree at the same time, the
 | 
			
		||||
**	updates may affect the scan.  We use the flags entry of the scan's
 | 
			
		||||
**	opaque space to record our actual position in response to updates
 | 
			
		||||
**	that we can't handle simply by adjusting pointers.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#define GS_CURBEFORE	((uint16) (1 << 0))
 | 
			
		||||
#define GS_MRKBEFORE	((uint16) (1 << 1))
 | 
			
		||||
 | 
			
		||||
/* root page of a gist */
 | 
			
		||||
#define GISTP_ROOT		0
 | 
			
		||||
#define GISTP_ROOT				0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
**  When we update a relation on which we're doing a scan, we need to
 | 
			
		||||
**  check the scan and fix it if the update affected any of the pages it
 | 
			
		||||
**  touches.  Otherwise, we can miss records that we should see.  The only
 | 
			
		||||
**  times we need to do this are for deletions and splits.  See the code in
 | 
			
		||||
**  gistscan.c for how the scan is fixed. These two constants tell us what sort
 | 
			
		||||
**  of operation changed the index.
 | 
			
		||||
**	When we update a relation on which we're doing a scan, we need to
 | 
			
		||||
**	check the scan and fix it if the update affected any of the pages it
 | 
			
		||||
**	touches.  Otherwise, we can miss records that we should see.  The only
 | 
			
		||||
**	times we need to do this are for deletions and splits.	See the code in
 | 
			
		||||
**	gistscan.c for how the scan is fixed. These two constants tell us what sort
 | 
			
		||||
**	of operation changed the index.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
#define	GISTOP_DEL	0
 | 
			
		||||
#define	GISTOP_SPLIT	1
 | 
			
		||||
#define GISTOP_DEL		0
 | 
			
		||||
#define GISTOP_SPLIT	1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** This is the Split Vector to be returned by the PickSplit method.
 | 
			
		||||
*/
 | 
			
		||||
typedef struct GIST_SPLITVEC {
 | 
			
		||||
    OffsetNumber	*spl_left;    /* array of entries that go left */
 | 
			
		||||
    int			spl_nleft;    /* size of this array */
 | 
			
		||||
    char		*spl_ldatum;  /* Union of keys in spl_left */
 | 
			
		||||
    OffsetNumber	*spl_right;   /* array of entries that go right */
 | 
			
		||||
    int			spl_nright;   /* size of the array */
 | 
			
		||||
    char		*spl_rdatum;  /* Union of keys in spl_right */
 | 
			
		||||
} GIST_SPLITVEC;
 | 
			
		||||
typedef struct GIST_SPLITVEC
 | 
			
		||||
{
 | 
			
		||||
	OffsetNumber   *spl_left;	/* array of entries that go left */
 | 
			
		||||
	int				spl_nleft;	/* size of this array */
 | 
			
		||||
	char		   *spl_ldatum; /* Union of keys in spl_left */
 | 
			
		||||
	OffsetNumber   *spl_right;	/* array of entries that go right */
 | 
			
		||||
	int				spl_nright; /* size of the array */
 | 
			
		||||
	char		   *spl_rdatum; /* Union of keys in spl_right */
 | 
			
		||||
}				GIST_SPLITVEC;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** An entry on a GiST node.  Contains the key (pred), as well as 
 | 
			
		||||
** An entry on a GiST node.  Contains the key (pred), as well as
 | 
			
		||||
** its own location (rel,page,offset) which can supply the matching
 | 
			
		||||
** pointer.  The size of the pred is in bytes, and leafkey is a flag to
 | 
			
		||||
** tell us if the entry is in a leaf node.
 | 
			
		||||
*/
 | 
			
		||||
typedef struct GISTENTRY {
 | 
			
		||||
    char *pred;
 | 
			
		||||
    Relation rel;
 | 
			
		||||
    Page page;
 | 
			
		||||
    OffsetNumber offset;
 | 
			
		||||
    int bytes;
 | 
			
		||||
    bool leafkey;
 | 
			
		||||
} GISTENTRY;
 | 
			
		||||
typedef struct GISTENTRY
 | 
			
		||||
{
 | 
			
		||||
	char		   *pred;
 | 
			
		||||
	Relation		rel;
 | 
			
		||||
	Page			page;
 | 
			
		||||
	OffsetNumber	offset;
 | 
			
		||||
	int				bytes;
 | 
			
		||||
	bool			leafkey;
 | 
			
		||||
}				GISTENTRY;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
** macro to initialize a GISTENTRY
 | 
			
		||||
@@ -156,40 +162,49 @@ typedef struct GISTENTRY {
 | 
			
		||||
#define TRLOWER(tr) (((tr)->bytes))
 | 
			
		||||
#define TRUPPER(tr) (&((tr)->bytes[MAXALIGN(VARSIZE(TRLOWER(tr)))]))
 | 
			
		||||
 | 
			
		||||
typedef struct txtrange {
 | 
			
		||||
    /* flag: NINF means that lower is negative infinity; PINF means that
 | 
			
		||||
    ** upper is positive infinity.  0 means that both are numbers.
 | 
			
		||||
    */
 | 
			
		||||
    int32 vl_len;
 | 
			
		||||
    int32 flag;  
 | 
			
		||||
    char bytes[2];
 | 
			
		||||
} TXTRANGE;
 | 
			
		||||
typedef struct txtrange
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
typedef struct intrange {
 | 
			
		||||
    int lower;
 | 
			
		||||
    int upper;
 | 
			
		||||
    /* flag: NINF means that lower is negative infinity; PINF means that
 | 
			
		||||
    ** upper is positive infinity.  0 means that both are numbers.
 | 
			
		||||
    */
 | 
			
		||||
    int flag;  
 | 
			
		||||
} INTRANGE;
 | 
			
		||||
	/*
 | 
			
		||||
	 * flag: NINF means that lower is negative infinity; PINF means that *
 | 
			
		||||
	 * upper is positive infinity.	0 means that both are numbers.
 | 
			
		||||
	 */
 | 
			
		||||
	int32			vl_len;
 | 
			
		||||
	int32			flag;
 | 
			
		||||
	char			bytes[2];
 | 
			
		||||
}				TXTRANGE;
 | 
			
		||||
 | 
			
		||||
extern void gistbuild(Relation heap,
 | 
			
		||||
	  Relation index, int natts,
 | 
			
		||||
	  AttrNumber *attnum, IndexStrategy istrat,
 | 
			
		||||
	  uint16 pint, Datum *params,
 | 
			
		||||
	  FuncIndexInfo *finfo,
 | 
			
		||||
	  PredInfo *predInfo);
 | 
			
		||||
extern InsertIndexResult gistinsert(Relation r, Datum *datum,
 | 
			
		||||
			char *nulls,ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern void _gistdump(Relation r);
 | 
			
		||||
extern void gistfreestack(GISTSTACK *s);
 | 
			
		||||
extern void initGISTstate(GISTSTATE *giststate, Relation index);
 | 
			
		||||
extern void gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, 
 | 
			
		||||
			   Relation r, Page pg, OffsetNumber o, int b, bool l) ;
 | 
			
		||||
typedef struct intrange
 | 
			
		||||
{
 | 
			
		||||
	int				lower;
 | 
			
		||||
	int				upper;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * flag: NINF means that lower is negative infinity; PINF means that *
 | 
			
		||||
	 * upper is positive infinity.	0 means that both are numbers.
 | 
			
		||||
	 */
 | 
			
		||||
	int				flag;
 | 
			
		||||
}				INTRANGE;
 | 
			
		||||
 | 
			
		||||
extern void
 | 
			
		||||
gistbuild(Relation heap,
 | 
			
		||||
		  Relation index, int natts,
 | 
			
		||||
		  AttrNumber * attnum, IndexStrategy istrat,
 | 
			
		||||
		  uint16 pint, Datum * params,
 | 
			
		||||
		  FuncIndexInfo * finfo,
 | 
			
		||||
		  PredInfo * predInfo);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
gistinsert(Relation r, Datum * datum,
 | 
			
		||||
		   char *nulls, ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern void		_gistdump(Relation r);
 | 
			
		||||
extern void		gistfreestack(GISTSTACK * s);
 | 
			
		||||
extern void		initGISTstate(GISTSTATE * giststate, Relation index);
 | 
			
		||||
extern void
 | 
			
		||||
gistdentryinit(GISTSTATE * giststate, GISTENTRY * e, char *pr,
 | 
			
		||||
			   Relation r, Page pg, OffsetNumber o, int b, bool l);
 | 
			
		||||
extern StrategyNumber RelationGetGISTStrategy(Relation, AttrNumber, RegProcedure);
 | 
			
		||||
 | 
			
		||||
/* gistget.c */
 | 
			
		||||
extern RetrieveIndexResult gistgettuple(IndexScanDesc s, ScanDirection dir);
 | 
			
		||||
 | 
			
		||||
#endif /* GIST_H */
 | 
			
		||||
#endif							/* GIST_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * gistscan.h--
 | 
			
		||||
 *    routines defined in access/gisr/gistscan.c
 | 
			
		||||
 *	  routines defined in access/gisr/gistscan.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
@@ -16,12 +16,13 @@
 | 
			
		||||
#include <storage/block.h>
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
extern IndexScanDesc gistbeginscan(Relation r, bool fromEnd,
 | 
			
		||||
		uint16 nkeys, ScanKey key);
 | 
			
		||||
extern void gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key);
 | 
			
		||||
extern void gistmarkpos(IndexScanDesc s);
 | 
			
		||||
extern void gistrestrpos(IndexScanDesc s);
 | 
			
		||||
extern void gistendscan(IndexScanDesc s);
 | 
			
		||||
extern void gistadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum);
 | 
			
		||||
extern IndexScanDesc
 | 
			
		||||
gistbeginscan(Relation r, bool fromEnd,
 | 
			
		||||
			  uint16 nkeys, ScanKey key);
 | 
			
		||||
extern void		gistrescan(IndexScanDesc s, bool fromEnd, ScanKey key);
 | 
			
		||||
extern void		gistmarkpos(IndexScanDesc s);
 | 
			
		||||
extern void		gistrestrpos(IndexScanDesc s);
 | 
			
		||||
extern void		gistendscan(IndexScanDesc s);
 | 
			
		||||
extern void		gistadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum);
 | 
			
		||||
 | 
			
		||||
#endif /* GISTSCAN_H */
 | 
			
		||||
#endif							/* GISTSCAN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * giststrat.h--
 | 
			
		||||
 *    routines defined in access/gist/giststrat.c
 | 
			
		||||
 *	  routines defined in access/gist/giststrat.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
@@ -15,7 +15,8 @@
 | 
			
		||||
#include <access/strat.h>
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
extern StrategyNumber RelationGetGISTStrategy(Relation r,
 | 
			
		||||
		AttrNumber attnum, RegProcedure proc);
 | 
			
		||||
extern StrategyNumber
 | 
			
		||||
RelationGetGISTStrategy(Relation r,
 | 
			
		||||
						AttrNumber attnum, RegProcedure proc);
 | 
			
		||||
 | 
			
		||||
#endif /* GISTSTRAT_H */
 | 
			
		||||
#endif							/* GISTSTRAT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,15 +1,15 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * hash.h--
 | 
			
		||||
 *    header file for postgres hash access method implementation 
 | 
			
		||||
 *	  header file for postgres hash access method implementation
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: hash.h,v 1.7 1997/08/19 21:37:27 momjian Exp $
 | 
			
		||||
 * $Id: hash.h,v 1.8 1997/09/07 04:55:54 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *	modeled after Margo Seltzer's hash implementation for unix. 
 | 
			
		||||
 *		modeled after Margo Seltzer's hash implementation for unix.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -22,44 +22,44 @@
 | 
			
		||||
#include <access/relscan.h>
 | 
			
		||||
#include <access/itup.h>
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
 * An overflow page is a spare page allocated for storing data whose 
 | 
			
		||||
/*
 | 
			
		||||
 * An overflow page is a spare page allocated for storing data whose
 | 
			
		||||
 * bucket doesn't have room to store it. We use overflow pages rather
 | 
			
		||||
 * than just splitting the bucket because there is a linear order in
 | 
			
		||||
 * the way we split buckets. In other words, if there isn't enough space
 | 
			
		||||
 * in the bucket itself, put it in an overflow page. 
 | 
			
		||||
 * in the bucket itself, put it in an overflow page.
 | 
			
		||||
 *
 | 
			
		||||
 * Overflow page addresses are stored in form: (Splitnumber, Page offset).
 | 
			
		||||
 *
 | 
			
		||||
 * A splitnumber is the number of the generation where the table doubles
 | 
			
		||||
 * in size. The ovflpage's offset within the splitnumber; offsets start
 | 
			
		||||
 * at 1. 
 | 
			
		||||
 * 
 | 
			
		||||
 * at 1.
 | 
			
		||||
 *
 | 
			
		||||
 * We convert the stored bitmap address into a page address with the
 | 
			
		||||
 * macro OADDR_OF(S, O) where S is the splitnumber and O is the page 
 | 
			
		||||
 * offset. 
 | 
			
		||||
 * macro OADDR_OF(S, O) where S is the splitnumber and O is the page
 | 
			
		||||
 * offset.
 | 
			
		||||
 */
 | 
			
		||||
typedef uint32 	Bucket;
 | 
			
		||||
typedef uint32	Bucket;
 | 
			
		||||
typedef bits16	OverflowPageAddress;
 | 
			
		||||
typedef uint32	SplitNumber;
 | 
			
		||||
typedef uint32  PageOffset;
 | 
			
		||||
typedef uint32	PageOffset;
 | 
			
		||||
 | 
			
		||||
/* A valid overflow address will always have a page offset >= 1 */
 | 
			
		||||
#define InvalidOvflAddress	0	
 | 
			
		||||
					   
 | 
			
		||||
#define SPLITSHIFT	11
 | 
			
		||||
#define SPLITMASK	0x7FF
 | 
			
		||||
#define SPLITNUM(N)	((SplitNumber)(((uint32)(N)) >> SPLITSHIFT))
 | 
			
		||||
#define OPAGENUM(N)	((PageOffset)((N) & SPLITMASK))
 | 
			
		||||
#define	OADDR_OF(S,O)	((OverflowPageAddress)((uint32)((uint32)(S) << SPLITSHIFT) + (O)))
 | 
			
		||||
#define InvalidOvflAddress		0
 | 
			
		||||
 | 
			
		||||
#define SPLITSHIFT		11
 | 
			
		||||
#define SPLITMASK		0x7FF
 | 
			
		||||
#define SPLITNUM(N)		((SplitNumber)(((uint32)(N)) >> SPLITSHIFT))
 | 
			
		||||
#define OPAGENUM(N)		((PageOffset)((N) & SPLITMASK))
 | 
			
		||||
#define OADDR_OF(S,O)	((OverflowPageAddress)((uint32)((uint32)(S) << SPLITSHIFT) + (O)))
 | 
			
		||||
 | 
			
		||||
#define BUCKET_TO_BLKNO(B) \
 | 
			
		||||
	((Bucket) ((B) + ((B) ? metap->SPARES[_hash_log2((B)+1)-1] : 0)) + 1)
 | 
			
		||||
#define OADDR_TO_BLKNO(B) 	 \
 | 
			
		||||
	((BlockNumber) \
 | 
			
		||||
	 (BUCKET_TO_BLKNO ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B))));
 | 
			
		||||
		((Bucket) ((B) + ((B) ? metap->SPARES[_hash_log2((B)+1)-1] : 0)) + 1)
 | 
			
		||||
#define OADDR_TO_BLKNO(B)		 \
 | 
			
		||||
		((BlockNumber) \
 | 
			
		||||
		 (BUCKET_TO_BLKNO ( (1 << SPLITNUM((B))) -1 ) + OPAGENUM((B))));
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
 * hasho_flag tells us which type of page we're looking at.  For
 | 
			
		||||
 * example, knowing overflow pages from bucket pages is necessary
 | 
			
		||||
 * information when you're deleting tuples from a page. If all the
 | 
			
		||||
@@ -69,44 +69,47 @@ typedef uint32  PageOffset;
 | 
			
		||||
 * necessary.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	LH_UNUSED_PAGE		(0)
 | 
			
		||||
#define LH_OVERFLOW_PAGE	(1 << 0)
 | 
			
		||||
#define LH_BUCKET_PAGE		(1 << 1)
 | 
			
		||||
#define	LH_BITMAP_PAGE		(1 << 2)
 | 
			
		||||
#define	LH_META_PAGE		(1 << 3)
 | 
			
		||||
#define LH_UNUSED_PAGE			(0)
 | 
			
		||||
#define LH_OVERFLOW_PAGE		(1 << 0)
 | 
			
		||||
#define LH_BUCKET_PAGE			(1 << 1)
 | 
			
		||||
#define LH_BITMAP_PAGE			(1 << 2)
 | 
			
		||||
#define LH_META_PAGE			(1 << 3)
 | 
			
		||||
 | 
			
		||||
typedef struct HashPageOpaqueData {
 | 
			
		||||
    bits16 hasho_flag;			/* is this page a bucket or ovfl */
 | 
			
		||||
    Bucket hasho_bucket;		/* bucket number this pg belongs to */
 | 
			
		||||
    OverflowPageAddress hasho_oaddr;	/* ovfl address of this ovfl pg */
 | 
			
		||||
    BlockNumber hasho_nextblkno;	/* next ovfl blkno */
 | 
			
		||||
    BlockNumber	hasho_prevblkno;	/* previous ovfl (or bucket) blkno */
 | 
			
		||||
} HashPageOpaqueData;
 | 
			
		||||
typedef struct HashPageOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	bits16			hasho_flag; /* is this page a bucket or ovfl */
 | 
			
		||||
	Bucket			hasho_bucket;		/* bucket number this pg belongs
 | 
			
		||||
										 * to */
 | 
			
		||||
	OverflowPageAddress hasho_oaddr;	/* ovfl address of this ovfl pg */
 | 
			
		||||
	BlockNumber		hasho_nextblkno;	/* next ovfl blkno */
 | 
			
		||||
	BlockNumber		hasho_prevblkno;	/* previous ovfl (or bucket) blkno */
 | 
			
		||||
}				HashPageOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef HashPageOpaqueData        *HashPageOpaque;
 | 
			
		||||
typedef HashPageOpaqueData *HashPageOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  ScanOpaqueData is used to remember which buffers we're currently
 | 
			
		||||
 *  examining in the scan.  We keep these buffers locked and pinned and
 | 
			
		||||
 *  recorded in the opaque entry of the scan in order to avoid doing a
 | 
			
		||||
 *  ReadBuffer() for every tuple in the index.  This avoids semop() calls,
 | 
			
		||||
 *  which are expensive.
 | 
			
		||||
 *	ScanOpaqueData is used to remember which buffers we're currently
 | 
			
		||||
 *	examining in the scan.	We keep these buffers locked and pinned and
 | 
			
		||||
 *	recorded in the opaque entry of the scan in order to avoid doing a
 | 
			
		||||
 *	ReadBuffer() for every tuple in the index.	This avoids semop() calls,
 | 
			
		||||
 *	which are expensive.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct HashScanOpaqueData {
 | 
			
		||||
    Buffer      hashso_curbuf;
 | 
			
		||||
    Buffer      hashso_mrkbuf;
 | 
			
		||||
} HashScanOpaqueData;
 | 
			
		||||
typedef struct HashScanOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	Buffer			hashso_curbuf;
 | 
			
		||||
	Buffer			hashso_mrkbuf;
 | 
			
		||||
}				HashScanOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef HashScanOpaqueData        *HashScanOpaque;
 | 
			
		||||
typedef HashScanOpaqueData *HashScanOpaque;
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
 * Definitions for metapage.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define HASH_METAPAGE	0		/* metapage is always block 0 */
 | 
			
		||||
 | 
			
		||||
#define HASH_MAGIC	0x6440640
 | 
			
		||||
#define HASH_MAGIC		0x6440640
 | 
			
		||||
#define HASH_VERSION	0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -116,168 +119,169 @@ typedef HashScanOpaqueData        *HashScanOpaque;
 | 
			
		||||
 * allocated at a certain splitpoint. For example, if spares[3] = 7
 | 
			
		||||
 * then there are a maximum of 7 ovflpages available at splitpoint 3.
 | 
			
		||||
 * The value in spares[] will change as ovflpages are added within
 | 
			
		||||
 * a splitpoint. 
 | 
			
		||||
 * 
 | 
			
		||||
 * a splitpoint.
 | 
			
		||||
 *
 | 
			
		||||
 * Within a splitpoint, one can find which ovflpages are available and
 | 
			
		||||
 * which are used by looking at a bitmaps that are stored on the ovfl
 | 
			
		||||
 * pages themselves. There is at least one bitmap for every splitpoint's
 | 
			
		||||
 * ovflpages. Bitmaps[] contains the ovflpage addresses of the ovflpages 
 | 
			
		||||
 * that hold the ovflpage bitmaps. 
 | 
			
		||||
 * ovflpages. Bitmaps[] contains the ovflpage addresses of the ovflpages
 | 
			
		||||
 * that hold the ovflpage bitmaps.
 | 
			
		||||
 *
 | 
			
		||||
 * The reason that the size is restricted to NCACHED (32) is because
 | 
			
		||||
 * the bitmaps are 16 bits: upper 5 represent the splitpoint, lower 11
 | 
			
		||||
 * indicate the page number within the splitpoint. Since there are 
 | 
			
		||||
 * only 5 bits to store the splitpoint, there can only be 32 splitpoints. 
 | 
			
		||||
 * indicate the page number within the splitpoint. Since there are
 | 
			
		||||
 * only 5 bits to store the splitpoint, there can only be 32 splitpoints.
 | 
			
		||||
 * Both spares[] and bitmaps[] use splitpoints as there indices, so there
 | 
			
		||||
 * can only be 32 of them. 
 | 
			
		||||
 * can only be 32 of them.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	NCACHED		32	
 | 
			
		||||
#define NCACHED			32
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct HashMetaPageData {
 | 
			
		||||
    PageHeaderData	hashm_phdr;		/* pad for page header
 | 
			
		||||
						   (do not use) */
 | 
			
		||||
    uint32		hashm_magic;		/* magic no. for hash tables */
 | 
			
		||||
    uint32		hashm_version;		/* version ID */
 | 
			
		||||
    uint32		hashm_nkeys;		/* number of keys stored in
 | 
			
		||||
						   the table */
 | 
			
		||||
    uint16		hashm_ffactor;		/* fill factor */
 | 
			
		||||
    uint16		hashm_bsize;		/* bucket size (bytes) -
 | 
			
		||||
						   must be a power of 2 */
 | 
			
		||||
    uint16		hashm_bshift;		/* bucket shift */
 | 
			
		||||
    uint16		hashm_bmsize;		/* bitmap array size (bytes) -
 | 
			
		||||
						   must be a power of 2 */
 | 
			
		||||
    uint32 		hashm_maxbucket;	/* ID of maximum bucket
 | 
			
		||||
						   in use */
 | 
			
		||||
    uint32		hashm_highmask;		/* mask to modulo into
 | 
			
		||||
						   entire table */
 | 
			
		||||
    uint32		hashm_lowmask;		/* mask to modulo into lower
 | 
			
		||||
						   half of table */
 | 
			
		||||
    uint32		hashm_ovflpoint;	/* pageno. from which ovflpgs
 | 
			
		||||
						   being allocated */
 | 
			
		||||
    uint32		hashm_lastfreed;	/* last ovflpage freed */
 | 
			
		||||
    uint32		hashm_nmaps;		/* Initial number of bitmaps */
 | 
			
		||||
    uint32		hashm_spares[NCACHED];	/* spare pages available at
 | 
			
		||||
						   splitpoints */
 | 
			
		||||
    BlockNumber		hashm_mapp[NCACHED];	/* blknumbers of ovfl page
 | 
			
		||||
						   maps */
 | 
			
		||||
    RegProcedure	hashm_procid;		/* hash procedure id from
 | 
			
		||||
						   pg_proc */
 | 
			
		||||
} HashMetaPageData;
 | 
			
		||||
typedef struct HashMetaPageData
 | 
			
		||||
{
 | 
			
		||||
	PageHeaderData	hashm_phdr; /* pad for page header (do not use) */
 | 
			
		||||
	uint32			hashm_magic;/* magic no. for hash tables */
 | 
			
		||||
	uint32			hashm_version;		/* version ID */
 | 
			
		||||
	uint32			hashm_nkeys;/* number of keys stored in the table */
 | 
			
		||||
	uint16			hashm_ffactor;		/* fill factor */
 | 
			
		||||
	uint16			hashm_bsize;/* bucket size (bytes) - must be a power
 | 
			
		||||
								 * of 2 */
 | 
			
		||||
	uint16			hashm_bshift;		/* bucket shift */
 | 
			
		||||
	uint16			hashm_bmsize;		/* bitmap array size (bytes) -
 | 
			
		||||
										 * must be a power of 2 */
 | 
			
		||||
	uint32			hashm_maxbucket;	/* ID of maximum bucket in use */
 | 
			
		||||
	uint32			hashm_highmask;		/* mask to modulo into entire
 | 
			
		||||
										 * table */
 | 
			
		||||
	uint32			hashm_lowmask;		/* mask to modulo into lower half
 | 
			
		||||
										 * of table */
 | 
			
		||||
	uint32			hashm_ovflpoint;	/* pageno. from which ovflpgs
 | 
			
		||||
										 * being allocated */
 | 
			
		||||
	uint32			hashm_lastfreed;	/* last ovflpage freed */
 | 
			
		||||
	uint32			hashm_nmaps;/* Initial number of bitmaps */
 | 
			
		||||
	uint32			hashm_spares[NCACHED];		/* spare pages available
 | 
			
		||||
												 * at splitpoints */
 | 
			
		||||
	BlockNumber		hashm_mapp[NCACHED];		/* blknumbers of ovfl page
 | 
			
		||||
												 * maps */
 | 
			
		||||
	RegProcedure	hashm_procid;		/* hash procedure id from pg_proc */
 | 
			
		||||
}				HashMetaPageData;
 | 
			
		||||
 | 
			
		||||
typedef HashMetaPageData *HashMetaPage;
 | 
			
		||||
 | 
			
		||||
/* Short hands for accessing structure */
 | 
			
		||||
#define BSHIFT		hashm_bshift
 | 
			
		||||
#define OVFL_POINT	hashm_ovflpoint
 | 
			
		||||
#define	LAST_FREED	hashm_lastfreed
 | 
			
		||||
#define MAX_BUCKET	hashm_maxbucket
 | 
			
		||||
#define FFACTOR		hashm_ffactor
 | 
			
		||||
#define HIGH_MASK	hashm_highmask
 | 
			
		||||
#define LOW_MASK	hashm_lowmask
 | 
			
		||||
#define NKEYS		hashm_nkeys
 | 
			
		||||
#define SPARES		hashm_spares
 | 
			
		||||
#define BSHIFT			hashm_bshift
 | 
			
		||||
#define OVFL_POINT		hashm_ovflpoint
 | 
			
		||||
#define LAST_FREED		hashm_lastfreed
 | 
			
		||||
#define MAX_BUCKET		hashm_maxbucket
 | 
			
		||||
#define FFACTOR			hashm_ffactor
 | 
			
		||||
#define HIGH_MASK		hashm_highmask
 | 
			
		||||
#define LOW_MASK		hashm_lowmask
 | 
			
		||||
#define NKEYS			hashm_nkeys
 | 
			
		||||
#define SPARES			hashm_spares
 | 
			
		||||
 | 
			
		||||
extern bool	BuildingHash;
 | 
			
		||||
extern bool		BuildingHash;
 | 
			
		||||
 | 
			
		||||
typedef struct HashItemData {
 | 
			
		||||
    IndexTupleData          hash_itup;
 | 
			
		||||
} HashItemData;
 | 
			
		||||
typedef struct HashItemData
 | 
			
		||||
{
 | 
			
		||||
	IndexTupleData	hash_itup;
 | 
			
		||||
}				HashItemData;
 | 
			
		||||
 | 
			
		||||
typedef HashItemData      *HashItem;
 | 
			
		||||
typedef HashItemData *HashItem;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Constants
 | 
			
		||||
 */
 | 
			
		||||
#define DEFAULT_FFACTOR		300
 | 
			
		||||
#define SPLITMAX		8
 | 
			
		||||
#define BYTE_TO_BIT		3	/* 2^3 bits/byte */
 | 
			
		||||
#define INT_TO_BYTE		2	/* 2^2 bytes/int */
 | 
			
		||||
#define INT_TO_BIT		5	/* 2^5 bits/int */
 | 
			
		||||
#define ALL_SET			((uint32) ~0)
 | 
			
		||||
#define DEFAULT_FFACTOR			300
 | 
			
		||||
#define SPLITMAX				8
 | 
			
		||||
#define BYTE_TO_BIT				3		/* 2^3 bits/byte */
 | 
			
		||||
#define INT_TO_BYTE				2		/* 2^2 bytes/int */
 | 
			
		||||
#define INT_TO_BIT				5		/* 2^5 bits/int */
 | 
			
		||||
#define ALL_SET					((uint32) ~0)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * bitmap pages do not contain tuples.  they do contain the standard
 | 
			
		||||
 * bitmap pages do not contain tuples.	they do contain the standard
 | 
			
		||||
 * page headers and trailers; however, everything in between is a
 | 
			
		||||
 * giant bit array.  the number of bits that fit on a page obviously
 | 
			
		||||
 * depends on the page size and the header/trailer overhead.
 | 
			
		||||
 */
 | 
			
		||||
#define	BMPGSZ_BYTE(metap)	((metap)->hashm_bmsize)
 | 
			
		||||
#define	BMPGSZ_BIT(metap)	((metap)->hashm_bmsize << BYTE_TO_BIT)
 | 
			
		||||
#define	HashPageGetBitmap(pg) \
 | 
			
		||||
    ((uint32 *) (((char *) (pg)) + DOUBLEALIGN(sizeof(PageHeaderData))))
 | 
			
		||||
#define BMPGSZ_BYTE(metap)		((metap)->hashm_bmsize)
 | 
			
		||||
#define BMPGSZ_BIT(metap)		((metap)->hashm_bmsize << BYTE_TO_BIT)
 | 
			
		||||
#define HashPageGetBitmap(pg) \
 | 
			
		||||
	((uint32 *) (((char *) (pg)) + DOUBLEALIGN(sizeof(PageHeaderData))))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * The number of bits in an ovflpage bitmap which
 | 
			
		||||
 * tells which ovflpages are empty versus in use (NOT the number of
 | 
			
		||||
 * bits in an overflow page *address* bitmap). 
 | 
			
		||||
 * bits in an overflow page *address* bitmap).
 | 
			
		||||
 */
 | 
			
		||||
#define BITS_PER_MAP	32	/* Number of bits in ovflpage bitmap */
 | 
			
		||||
#define BITS_PER_MAP	32		/* Number of bits in ovflpage bitmap */
 | 
			
		||||
 | 
			
		||||
/* Given the address of the beginning of a big map, clear/set the nth bit */
 | 
			
		||||
#define CLRBIT(A, N)	((A)[(N)/BITS_PER_MAP] &= ~(1<<((N)%BITS_PER_MAP)))
 | 
			
		||||
#define SETBIT(A, N)	((A)[(N)/BITS_PER_MAP] |= (1<<((N)%BITS_PER_MAP)))
 | 
			
		||||
#define ISSET(A, N)	((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
 | 
			
		||||
#define ISSET(A, N)		((A)[(N)/BITS_PER_MAP] & (1<<((N)%BITS_PER_MAP)))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * page locking modes
 | 
			
		||||
 */
 | 
			
		||||
#define	HASH_READ	0
 | 
			
		||||
#define	HASH_WRITE	1
 | 
			
		||||
 | 
			
		||||
/*  
 | 
			
		||||
 *  In general, the hash code tries to localize its knowledge about page
 | 
			
		||||
 *  layout to a couple of routines.  However, we need a special value to
 | 
			
		||||
 *  indicate "no page number" in those places where we expect page numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define P_NONE		0
 | 
			
		||||
#define HASH_READ		0
 | 
			
		||||
#define HASH_WRITE		1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  Strategy number. There's only one valid strategy for hashing: equality.
 | 
			
		||||
 *	In general, the hash code tries to localize its knowledge about page
 | 
			
		||||
 *	layout to a couple of routines.  However, we need a special value to
 | 
			
		||||
 *	indicate "no page number" in those places where we expect page numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define HTEqualStrategyNumber		1
 | 
			
		||||
#define HTMaxStrategyNumber		1
 | 
			
		||||
#define P_NONE			0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When a new operator class is declared, we require that the user supply
 | 
			
		||||
 *  us with an amproc procudure for hashing a key of the new type.
 | 
			
		||||
 *  Since we only have one such proc in amproc, it's number 1.
 | 
			
		||||
 *	Strategy number. There's only one valid strategy for hashing: equality.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define HASHPROC	1
 | 
			
		||||
#define HTEqualStrategyNumber			1
 | 
			
		||||
#define HTMaxStrategyNumber				1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	When a new operator class is declared, we require that the user supply
 | 
			
		||||
 *	us with an amproc procudure for hashing a key of the new type.
 | 
			
		||||
 *	Since we only have one such proc in amproc, it's number 1.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define HASHPROC		1
 | 
			
		||||
 | 
			
		||||
/* public routines */
 | 
			
		||||
 | 
			
		||||
extern void hashbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
	AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
	Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
 | 
			
		||||
extern InsertIndexResult hashinsert(Relation rel, Datum *datum, char *nulls,
 | 
			
		||||
				    ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char *hashgettuple(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern char *hashbeginscan(Relation rel, bool fromEnd, uint16 keysz,
 | 
			
		||||
			   ScanKey scankey);
 | 
			
		||||
extern void hashrescan(IndexScanDesc scan, bool fromEnd, ScanKey scankey);
 | 
			
		||||
extern void hashendscan(IndexScanDesc scan);
 | 
			
		||||
extern void hashmarkpos(IndexScanDesc scan);
 | 
			
		||||
extern void hashrestrpos(IndexScanDesc scan);
 | 
			
		||||
extern void hashdelete(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void
 | 
			
		||||
hashbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
		  AttrNumber * attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
		  Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
hashinsert(Relation rel, Datum * datum, char *nulls,
 | 
			
		||||
		   ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char    *hashgettuple(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern char    *
 | 
			
		||||
hashbeginscan(Relation rel, bool fromEnd, uint16 keysz,
 | 
			
		||||
			  ScanKey scankey);
 | 
			
		||||
extern void		hashrescan(IndexScanDesc scan, bool fromEnd, ScanKey scankey);
 | 
			
		||||
extern void		hashendscan(IndexScanDesc scan);
 | 
			
		||||
extern void		hashmarkpos(IndexScanDesc scan);
 | 
			
		||||
extern void		hashrestrpos(IndexScanDesc scan);
 | 
			
		||||
extern void		hashdelete(Relation rel, ItemPointer tid);
 | 
			
		||||
 | 
			
		||||
/* hashfunc.c */
 | 
			
		||||
extern uint32 hashint2(int16 key);
 | 
			
		||||
extern uint32 hashint4(uint32 key);
 | 
			
		||||
extern uint32 hashfloat4(float32 keyp);
 | 
			
		||||
extern uint32 hashfloat8(float64 keyp);
 | 
			
		||||
extern uint32 hashoid(Oid key);
 | 
			
		||||
extern uint32 hashchar(char key);
 | 
			
		||||
extern uint32 hashchar2(uint16 intkey);
 | 
			
		||||
extern uint32 hashchar4(uint32 intkey);
 | 
			
		||||
extern uint32 hashchar8(char *key);
 | 
			
		||||
extern uint32 hashchar16(char *key);
 | 
			
		||||
extern uint32 hashtext(struct varlena *key);
 | 
			
		||||
extern uint32 hashname(NameData *n);
 | 
			
		||||
extern uint32	hashint2(int16 key);
 | 
			
		||||
extern uint32	hashint4(uint32 key);
 | 
			
		||||
extern uint32	hashfloat4(float32 keyp);
 | 
			
		||||
extern uint32	hashfloat8(float64 keyp);
 | 
			
		||||
extern uint32	hashoid(Oid key);
 | 
			
		||||
extern uint32	hashchar(char key);
 | 
			
		||||
extern uint32	hashchar2(uint16 intkey);
 | 
			
		||||
extern uint32	hashchar4(uint32 intkey);
 | 
			
		||||
extern uint32	hashchar8(char *key);
 | 
			
		||||
extern uint32	hashchar16(char *key);
 | 
			
		||||
extern uint32	hashtext(struct varlena * key);
 | 
			
		||||
extern uint32	hashname(NameData * n);
 | 
			
		||||
 | 
			
		||||
/* private routines */
 | 
			
		||||
 | 
			
		||||
@@ -286,50 +290,56 @@ extern InsertIndexResult _hash_doinsert(Relation rel, HashItem hitem);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* hashovfl.c */
 | 
			
		||||
extern Buffer _hash_addovflpage(Relation rel, Buffer *metabufp, Buffer buf);
 | 
			
		||||
extern Buffer _hash_freeovflpage(Relation rel, Buffer ovflbuf);
 | 
			
		||||
extern int32 _hash_initbitmap(Relation rel, HashMetaPage metap, int32 pnum,
 | 
			
		||||
			      int32 nbits, int32 ndx);
 | 
			
		||||
extern void _hash_squeezebucket(Relation rel, HashMetaPage metap,
 | 
			
		||||
				Bucket bucket);
 | 
			
		||||
extern Buffer	_hash_addovflpage(Relation rel, Buffer * metabufp, Buffer buf);
 | 
			
		||||
extern Buffer	_hash_freeovflpage(Relation rel, Buffer ovflbuf);
 | 
			
		||||
extern int32
 | 
			
		||||
_hash_initbitmap(Relation rel, HashMetaPage metap, int32 pnum,
 | 
			
		||||
				 int32 nbits, int32 ndx);
 | 
			
		||||
extern void
 | 
			
		||||
_hash_squeezebucket(Relation rel, HashMetaPage metap,
 | 
			
		||||
					Bucket bucket);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* hashpage.c */
 | 
			
		||||
extern void _hash_metapinit(Relation rel);
 | 
			
		||||
extern Buffer _hash_getbuf(Relation rel, BlockNumber blkno, int access);
 | 
			
		||||
extern void _hash_relbuf(Relation rel, Buffer buf, int access);
 | 
			
		||||
extern void _hash_wrtbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void _hash_wrtnorelbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern Page _hash_chgbufaccess(Relation rel, Buffer *bufp, int from_access,
 | 
			
		||||
			       int to_access);
 | 
			
		||||
extern void _hash_pageinit(Page page, Size size);
 | 
			
		||||
extern void _hash_pagedel(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void _hash_expandtable(Relation rel, Buffer metabuf);
 | 
			
		||||
extern void		_hash_metapinit(Relation rel);
 | 
			
		||||
extern Buffer	_hash_getbuf(Relation rel, BlockNumber blkno, int access);
 | 
			
		||||
extern void		_hash_relbuf(Relation rel, Buffer buf, int access);
 | 
			
		||||
extern void		_hash_wrtbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void		_hash_wrtnorelbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern Page
 | 
			
		||||
_hash_chgbufaccess(Relation rel, Buffer * bufp, int from_access,
 | 
			
		||||
				   int to_access);
 | 
			
		||||
extern void		_hash_pageinit(Page page, Size size);
 | 
			
		||||
extern void		_hash_pagedel(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void		_hash_expandtable(Relation rel, Buffer metabuf);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* hashscan.c */
 | 
			
		||||
extern void _hash_regscan(IndexScanDesc scan);
 | 
			
		||||
extern void _hash_dropscan(IndexScanDesc scan);
 | 
			
		||||
extern void _hash_adjscans(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void		_hash_regscan(IndexScanDesc scan);
 | 
			
		||||
extern void		_hash_dropscan(IndexScanDesc scan);
 | 
			
		||||
extern void		_hash_adjscans(Relation rel, ItemPointer tid);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* hashsearch.c */
 | 
			
		||||
extern void _hash_search(Relation rel, int keysz, ScanKey scankey,
 | 
			
		||||
			 Buffer *bufP, HashMetaPage metap);
 | 
			
		||||
extern void
 | 
			
		||||
_hash_search(Relation rel, int keysz, ScanKey scankey,
 | 
			
		||||
			 Buffer * bufP, HashMetaPage metap);
 | 
			
		||||
extern RetrieveIndexResult _hash_next(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern RetrieveIndexResult _hash_first(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern bool _hash_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir,
 | 
			
		||||
		       Buffer metabuf);
 | 
			
		||||
extern bool
 | 
			
		||||
_hash_step(IndexScanDesc scan, Buffer * bufP, ScanDirection dir,
 | 
			
		||||
		   Buffer metabuf);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* hashutil.c */
 | 
			
		||||
extern ScanKey _hash_mkscankey(Relation rel, IndexTuple itup,
 | 
			
		||||
			       HashMetaPage metap);
 | 
			
		||||
extern void _hash_freeskey(ScanKey skey);
 | 
			
		||||
extern bool _hash_checkqual(IndexScanDesc scan, IndexTuple itup);
 | 
			
		||||
extern ScanKey
 | 
			
		||||
_hash_mkscankey(Relation rel, IndexTuple itup,
 | 
			
		||||
				HashMetaPage metap);
 | 
			
		||||
extern void		_hash_freeskey(ScanKey skey);
 | 
			
		||||
extern bool		_hash_checkqual(IndexScanDesc scan, IndexTuple itup);
 | 
			
		||||
extern HashItem _hash_formitem(IndexTuple itup);
 | 
			
		||||
extern Bucket _hash_call(Relation rel, HashMetaPage metap, Datum key);
 | 
			
		||||
extern uint32 _hash_log2(uint32 num);
 | 
			
		||||
extern void _hash_checkpage(Page page, int flags);
 | 
			
		||||
extern Bucket	_hash_call(Relation rel, HashMetaPage metap, Datum key);
 | 
			
		||||
extern uint32	_hash_log2(uint32 num);
 | 
			
		||||
extern void		_hash_checkpage(Page page, int flags);
 | 
			
		||||
 | 
			
		||||
#endif	/* HASH_H */
 | 
			
		||||
#endif							/* HASH_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * heapam.h--
 | 
			
		||||
 *    POSTGRES heap access method definitions.
 | 
			
		||||
 *	  POSTGRES heap access method definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: heapam.h,v 1.11 1997/09/04 16:20:55 momjian Exp $
 | 
			
		||||
 * $Id: heapam.h,v 1.12 1997/09/07 04:55:55 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	HEAPAM_H
 | 
			
		||||
#ifndef HEAPAM_H
 | 
			
		||||
#define HEAPAM_H
 | 
			
		||||
 | 
			
		||||
#include <access/htup.h>
 | 
			
		||||
@@ -19,142 +19,154 @@
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *		heap access method statistics
 | 
			
		||||
 *				heap access method statistics
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct HeapAccessStatisticsData {
 | 
			
		||||
    time_t  init_global_timestamp;	/* time global statistics started */
 | 
			
		||||
    time_t  local_reset_timestamp;	/* last time local reset was done */
 | 
			
		||||
    time_t  last_request_timestamp;	/* last time stats were requested */
 | 
			
		||||
typedef struct HeapAccessStatisticsData
 | 
			
		||||
{
 | 
			
		||||
	time_t			init_global_timestamp;		/* time global statistics
 | 
			
		||||
												 * started */
 | 
			
		||||
	time_t			local_reset_timestamp;		/* last time local reset
 | 
			
		||||
												 * was done */
 | 
			
		||||
	time_t			last_request_timestamp;		/* last time stats were
 | 
			
		||||
												 * requested */
 | 
			
		||||
 | 
			
		||||
    int global_open;			
 | 
			
		||||
    int global_openr;
 | 
			
		||||
    int global_close;
 | 
			
		||||
    int global_beginscan;
 | 
			
		||||
    int global_rescan;
 | 
			
		||||
    int global_endscan;
 | 
			
		||||
    int global_getnext;
 | 
			
		||||
    int global_fetch;
 | 
			
		||||
    int global_insert;
 | 
			
		||||
    int global_delete;
 | 
			
		||||
    int global_replace; 
 | 
			
		||||
    int global_markpos; 
 | 
			
		||||
    int global_restrpos;
 | 
			
		||||
    int global_BufferGetRelation;
 | 
			
		||||
    int global_RelationIdGetRelation;
 | 
			
		||||
    int global_RelationIdGetRelation_Buf;
 | 
			
		||||
    int global_RelationNameGetRelation;
 | 
			
		||||
    int global_getreldesc;
 | 
			
		||||
    int global_heapgettup;
 | 
			
		||||
    int global_RelationPutHeapTuple;
 | 
			
		||||
    int global_RelationPutLongHeapTuple;
 | 
			
		||||
	int				global_open;
 | 
			
		||||
	int				global_openr;
 | 
			
		||||
	int				global_close;
 | 
			
		||||
	int				global_beginscan;
 | 
			
		||||
	int				global_rescan;
 | 
			
		||||
	int				global_endscan;
 | 
			
		||||
	int				global_getnext;
 | 
			
		||||
	int				global_fetch;
 | 
			
		||||
	int				global_insert;
 | 
			
		||||
	int				global_delete;
 | 
			
		||||
	int				global_replace;
 | 
			
		||||
	int				global_markpos;
 | 
			
		||||
	int				global_restrpos;
 | 
			
		||||
	int				global_BufferGetRelation;
 | 
			
		||||
	int				global_RelationIdGetRelation;
 | 
			
		||||
	int				global_RelationIdGetRelation_Buf;
 | 
			
		||||
	int				global_RelationNameGetRelation;
 | 
			
		||||
	int				global_getreldesc;
 | 
			
		||||
	int				global_heapgettup;
 | 
			
		||||
	int				global_RelationPutHeapTuple;
 | 
			
		||||
	int				global_RelationPutLongHeapTuple;
 | 
			
		||||
 | 
			
		||||
    int local_open;			
 | 
			
		||||
    int local_openr;
 | 
			
		||||
    int local_close;
 | 
			
		||||
    int local_beginscan;
 | 
			
		||||
    int local_rescan;
 | 
			
		||||
    int local_endscan;
 | 
			
		||||
    int local_getnext;
 | 
			
		||||
    int local_fetch;
 | 
			
		||||
    int local_insert;
 | 
			
		||||
    int local_delete;
 | 
			
		||||
    int local_replace; 
 | 
			
		||||
    int local_markpos; 
 | 
			
		||||
    int local_restrpos;
 | 
			
		||||
    int local_BufferGetRelation;
 | 
			
		||||
    int local_RelationIdGetRelation;
 | 
			
		||||
    int local_RelationIdGetRelation_Buf;
 | 
			
		||||
    int local_RelationNameGetRelation;
 | 
			
		||||
    int local_getreldesc;
 | 
			
		||||
    int local_heapgettup;
 | 
			
		||||
    int local_RelationPutHeapTuple;
 | 
			
		||||
    int local_RelationPutLongHeapTuple;
 | 
			
		||||
} HeapAccessStatisticsData;
 | 
			
		||||
	int				local_open;
 | 
			
		||||
	int				local_openr;
 | 
			
		||||
	int				local_close;
 | 
			
		||||
	int				local_beginscan;
 | 
			
		||||
	int				local_rescan;
 | 
			
		||||
	int				local_endscan;
 | 
			
		||||
	int				local_getnext;
 | 
			
		||||
	int				local_fetch;
 | 
			
		||||
	int				local_insert;
 | 
			
		||||
	int				local_delete;
 | 
			
		||||
	int				local_replace;
 | 
			
		||||
	int				local_markpos;
 | 
			
		||||
	int				local_restrpos;
 | 
			
		||||
	int				local_BufferGetRelation;
 | 
			
		||||
	int				local_RelationIdGetRelation;
 | 
			
		||||
	int				local_RelationIdGetRelation_Buf;
 | 
			
		||||
	int				local_RelationNameGetRelation;
 | 
			
		||||
	int				local_getreldesc;
 | 
			
		||||
	int				local_heapgettup;
 | 
			
		||||
	int				local_RelationPutHeapTuple;
 | 
			
		||||
	int				local_RelationPutLongHeapTuple;
 | 
			
		||||
}				HeapAccessStatisticsData;
 | 
			
		||||
 | 
			
		||||
typedef HeapAccessStatisticsData *HeapAccessStatistics;
 | 
			
		||||
 | 
			
		||||
#define IncrHeapAccessStat(x) \
 | 
			
		||||
    (heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
 | 
			
		||||
	(heap_access_stats == NULL ? 0 : (heap_access_stats->x)++)
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *      heap_getattr
 | 
			
		||||
 *		heap_getattr
 | 
			
		||||
 *
 | 
			
		||||
 *      Find a particular field in a row represented as a heap tuple.
 | 
			
		||||
 *      We return a pointer into that heap tuple, which points to the
 | 
			
		||||
 *      first byte of the value of the field in question.
 | 
			
		||||
 *		Find a particular field in a row represented as a heap tuple.
 | 
			
		||||
 *		We return a pointer into that heap tuple, which points to the
 | 
			
		||||
 *		first byte of the value of the field in question.
 | 
			
		||||
 *
 | 
			
		||||
 *      If the field in question has a NULL value, we return a null
 | 
			
		||||
 *      pointer and return <*isnull> == true.  Otherwise, we return
 | 
			
		||||
 *      <*isnull> == false.
 | 
			
		||||
 *		If the field in question has a NULL value, we return a null
 | 
			
		||||
 *		pointer and return <*isnull> == true.  Otherwise, we return
 | 
			
		||||
 *		<*isnull> == false.
 | 
			
		||||
 *
 | 
			
		||||
 *      <tup> is the pointer to the heap tuple.  <attnum> is the attribute
 | 
			
		||||
 *      number of the column (field) caller wants.  <tupleDesc> is a 
 | 
			
		||||
 *      pointer to the structure describing the row and all its fields.
 | 
			
		||||
 *		<tup> is the pointer to the heap tuple.  <attnum> is the attribute
 | 
			
		||||
 *		number of the column (field) caller wants.	<tupleDesc> is a
 | 
			
		||||
 *		pointer to the structure describing the row and all its fields.
 | 
			
		||||
 * ---------------- */
 | 
			
		||||
#define heap_getattr(tup, b, attnum, tupleDesc, isnull) \
 | 
			
		||||
    (AssertMacro((tup) != NULL) ? \
 | 
			
		||||
	((attnum) > (int) (tup)->t_natts) ? \
 | 
			
		||||
	    (((isnull) ? (*(isnull) = true) : (char)NULL), (char *)NULL) : \
 | 
			
		||||
	((attnum) > 0) ? \
 | 
			
		||||
	    fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
 | 
			
		||||
	(((isnull) ? (*(isnull) = false) : (char)NULL), heap_getsysattr((tup), (b), (attnum))) : \
 | 
			
		||||
    (char *)NULL)
 | 
			
		||||
	(AssertMacro((tup) != NULL) ? \
 | 
			
		||||
		((attnum) > (int) (tup)->t_natts) ? \
 | 
			
		||||
			(((isnull) ? (*(isnull) = true) : (char)NULL), (char *)NULL) : \
 | 
			
		||||
		((attnum) > 0) ? \
 | 
			
		||||
			fastgetattr((tup), (attnum), (tupleDesc), (isnull)) : \
 | 
			
		||||
		(((isnull) ? (*(isnull) = false) : (char)NULL), heap_getsysattr((tup), (b), (attnum))) : \
 | 
			
		||||
	(char *)NULL)
 | 
			
		||||
 | 
			
		||||
extern HeapAccessStatistics heap_access_stats;	/* in stats.c */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	function prototypes for heap access method
 | 
			
		||||
 *		function prototypes for heap access method
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
/* heap_create, heap_creatr, and heap_destroy are declared in catalog/heap.h */
 | 
			
		||||
 | 
			
		||||
/* heapam.c */
 | 
			
		||||
extern void doinsert(Relation relation, HeapTuple tup);
 | 
			
		||||
extern void		doinsert(Relation relation, HeapTuple tup);
 | 
			
		||||
 | 
			
		||||
extern Relation heap_open(Oid relationId);
 | 
			
		||||
extern Relation heap_openr(char *relationName);
 | 
			
		||||
extern void heap_close(Relation relation);
 | 
			
		||||
extern HeapScanDesc heap_beginscan(Relation relation, int atend,
 | 
			
		||||
			    TimeQual timeQual, unsigned nkeys, ScanKey key);
 | 
			
		||||
extern void heap_rescan(HeapScanDesc sdesc, bool scanFromEnd, ScanKey key);
 | 
			
		||||
extern void heap_endscan(HeapScanDesc sdesc);
 | 
			
		||||
extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer *b);
 | 
			
		||||
extern HeapTuple heap_fetch(Relation relation, TimeQual timeQual,
 | 
			
		||||
			    ItemPointer tid, Buffer *b);
 | 
			
		||||
extern Oid heap_insert(Relation relation, HeapTuple tup);
 | 
			
		||||
extern int heap_delete(Relation relation, ItemPointer tid);
 | 
			
		||||
extern int heap_replace(Relation relation, ItemPointer otid,
 | 
			
		||||
			HeapTuple tup);
 | 
			
		||||
extern void heap_markpos(HeapScanDesc sdesc);
 | 
			
		||||
extern void heap_restrpos(HeapScanDesc sdesc);
 | 
			
		||||
extern void		heap_close(Relation relation);
 | 
			
		||||
extern HeapScanDesc
 | 
			
		||||
heap_beginscan(Relation relation, int atend,
 | 
			
		||||
			   TimeQual timeQual, unsigned nkeys, ScanKey key);
 | 
			
		||||
extern void		heap_rescan(HeapScanDesc sdesc, bool scanFromEnd, ScanKey key);
 | 
			
		||||
extern void		heap_endscan(HeapScanDesc sdesc);
 | 
			
		||||
extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer * b);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
heap_fetch(Relation relation, TimeQual timeQual,
 | 
			
		||||
		   ItemPointer tid, Buffer * b);
 | 
			
		||||
extern Oid		heap_insert(Relation relation, HeapTuple tup);
 | 
			
		||||
extern int		heap_delete(Relation relation, ItemPointer tid);
 | 
			
		||||
extern int
 | 
			
		||||
heap_replace(Relation relation, ItemPointer otid,
 | 
			
		||||
			 HeapTuple tup);
 | 
			
		||||
extern void		heap_markpos(HeapScanDesc sdesc);
 | 
			
		||||
extern void		heap_restrpos(HeapScanDesc sdesc);
 | 
			
		||||
 | 
			
		||||
/* in common/heaptuple.c */
 | 
			
		||||
extern Size ComputeDataSize(TupleDesc tupleDesc, Datum value[], char nulls[]);
 | 
			
		||||
extern void DataFill(char *data, TupleDesc tupleDesc,
 | 
			
		||||
		     Datum value[], char nulls[], char *infomask,
 | 
			
		||||
		     bits8 *bit);
 | 
			
		||||
extern int heap_attisnull(HeapTuple tup, int attnum);
 | 
			
		||||
extern int heap_sysattrlen(AttrNumber attno);
 | 
			
		||||
extern bool heap_sysattrbyval(AttrNumber attno);
 | 
			
		||||
extern char *heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
 | 
			
		||||
extern char *fastgetattr(HeapTuple tup, int attnum,
 | 
			
		||||
			 TupleDesc att, bool *isnull);
 | 
			
		||||
extern Size		ComputeDataSize(TupleDesc tupleDesc, Datum value[], char nulls[]);
 | 
			
		||||
extern void
 | 
			
		||||
DataFill(char *data, TupleDesc tupleDesc,
 | 
			
		||||
		 Datum value[], char nulls[], char *infomask,
 | 
			
		||||
		 bits8 * bit);
 | 
			
		||||
extern int		heap_attisnull(HeapTuple tup, int attnum);
 | 
			
		||||
extern int		heap_sysattrlen(AttrNumber attno);
 | 
			
		||||
extern bool		heap_sysattrbyval(AttrNumber attno);
 | 
			
		||||
extern char    *heap_getsysattr(HeapTuple tup, Buffer b, int attnum);
 | 
			
		||||
extern char    *
 | 
			
		||||
fastgetattr(HeapTuple tup, int attnum,
 | 
			
		||||
			TupleDesc att, bool * isnull);
 | 
			
		||||
extern HeapTuple heap_copytuple(HeapTuple tuple);
 | 
			
		||||
extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor, 
 | 
			
		||||
				Datum value[], char nulls[]);
 | 
			
		||||
extern HeapTuple heap_modifytuple(HeapTuple tuple, Buffer buffer,
 | 
			
		||||
	Relation relation, Datum replValue[], char replNull[], char repl[]);
 | 
			
		||||
HeapTuple heap_addheader(uint32	natts, int structlen, char *structure);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
heap_formtuple(TupleDesc tupleDescriptor,
 | 
			
		||||
			   Datum value[], char nulls[]);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
heap_modifytuple(HeapTuple tuple, Buffer buffer,
 | 
			
		||||
	 Relation relation, Datum replValue[], char replNull[], char repl[]);
 | 
			
		||||
HeapTuple		heap_addheader(uint32 natts, int structlen, char *structure);
 | 
			
		||||
 | 
			
		||||
/* in common/heap/stats.c */
 | 
			
		||||
extern void PrintHeapAccessStatistics(HeapAccessStatistics stats);
 | 
			
		||||
extern void initam(void);
 | 
			
		||||
extern void		PrintHeapAccessStatistics(HeapAccessStatistics stats);
 | 
			
		||||
extern void		initam(void);
 | 
			
		||||
 | 
			
		||||
/* hio.c */
 | 
			
		||||
extern void RelationPutHeapTuple(Relation relation, BlockNumber blockIndex,
 | 
			
		||||
		     HeapTuple tuple);
 | 
			
		||||
extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
 | 
			
		||||
extern void
 | 
			
		||||
RelationPutHeapTuple(Relation relation, BlockNumber blockIndex,
 | 
			
		||||
					 HeapTuple tuple);
 | 
			
		||||
extern void		RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
 | 
			
		||||
 | 
			
		||||
#endif	/* HEAPAM_H */
 | 
			
		||||
#endif							/* HEAPAM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,25 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * hio.h--
 | 
			
		||||
 *    POSTGRES heap access method input/output definitions.
 | 
			
		||||
 *	  POSTGRES heap access method input/output definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: hio.h,v 1.3 1996/11/05 10:37:05 scrappy Exp $
 | 
			
		||||
 * $Id: hio.h,v 1.4 1997/09/07 04:55:56 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	HIO_H
 | 
			
		||||
#ifndef HIO_H
 | 
			
		||||
#define HIO_H
 | 
			
		||||
 | 
			
		||||
#include <access/htup.h>
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern void RelationPutHeapTuple(Relation relation, BlockNumber blockIndex,
 | 
			
		||||
				 HeapTuple tuple);
 | 
			
		||||
extern void RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
 | 
			
		||||
extern void
 | 
			
		||||
RelationPutHeapTuple(Relation relation, BlockNumber blockIndex,
 | 
			
		||||
					 HeapTuple tuple);
 | 
			
		||||
extern void		RelationPutHeapTupleAtEnd(Relation relation, HeapTuple tuple);
 | 
			
		||||
 | 
			
		||||
#endif	/* HIO_H */
 | 
			
		||||
#endif							/* HIO_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * htup.h--
 | 
			
		||||
 *    POSTGRES heap tuple definitions.
 | 
			
		||||
 *	  POSTGRES heap tuple definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: htup.h,v 1.3 1996/11/04 07:18:11 scrappy Exp $
 | 
			
		||||
 * $Id: htup.h,v 1.4 1997/09/07 04:55:58 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	HTUP_H
 | 
			
		||||
#ifndef HTUP_H
 | 
			
		||||
#define HTUP_H
 | 
			
		||||
 | 
			
		||||
#include <utils/nabstime.h>
 | 
			
		||||
@@ -20,94 +20,95 @@
 | 
			
		||||
 | 
			
		||||
/* check these, they are likely to be more severely limited by t_hoff */
 | 
			
		||||
 | 
			
		||||
#define MaxHeapAttributeNumber	1600		/* 8 * 200 */
 | 
			
		||||
#define MaxHeapAttributeNumber	1600	/* 8 * 200 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * to avoid wasting space, the attributes should be layed out in such a
 | 
			
		||||
 * way to reduce structure padding.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct HeapTupleData {
 | 
			
		||||
typedef struct HeapTupleData
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    unsigned int	t_len;		/* length of entire tuple */
 | 
			
		||||
	unsigned int	t_len;		/* length of entire tuple */
 | 
			
		||||
 | 
			
		||||
    ItemPointerData	t_ctid;		/* current TID of this tuple */
 | 
			
		||||
	ItemPointerData t_ctid;		/* current TID of this tuple */
 | 
			
		||||
 | 
			
		||||
    ItemPointerData	t_chain;	/* replaced tuple TID */
 | 
			
		||||
	ItemPointerData t_chain;	/* replaced tuple TID */
 | 
			
		||||
 | 
			
		||||
    Oid			t_oid;		/* OID of this tuple -- 4 bytes */
 | 
			
		||||
	Oid				t_oid;		/* OID of this tuple -- 4 bytes */
 | 
			
		||||
 | 
			
		||||
    CommandId		t_cmin;		/* insert CID stamp -- 2 bytes each */
 | 
			
		||||
    CommandId		t_cmax;		/* delete CommandId stamp */
 | 
			
		||||
	CommandId		t_cmin;		/* insert CID stamp -- 2 bytes each */
 | 
			
		||||
	CommandId		t_cmax;		/* delete CommandId stamp */
 | 
			
		||||
 | 
			
		||||
    TransactionId	t_xmin;		/* insert XID stamp -- 4 bytes each */
 | 
			
		||||
    TransactionId	t_xmax;		/* delete XID stamp */
 | 
			
		||||
	TransactionId	t_xmin;		/* insert XID stamp -- 4 bytes each */
 | 
			
		||||
	TransactionId	t_xmax;		/* delete XID stamp */
 | 
			
		||||
 | 
			
		||||
    AbsoluteTime	t_tmin;		/* time stamps -- 4 bytes each */
 | 
			
		||||
    AbsoluteTime	t_tmax;	
 | 
			
		||||
	AbsoluteTime	t_tmin;		/* time stamps -- 4 bytes each */
 | 
			
		||||
	AbsoluteTime	t_tmax;
 | 
			
		||||
 | 
			
		||||
    int16		t_natts;	/* number of attributes */
 | 
			
		||||
    char		t_vtype;	/* not used - padding */
 | 
			
		||||
	int16			t_natts;	/* number of attributes */
 | 
			
		||||
	char			t_vtype;	/* not used - padding */
 | 
			
		||||
 | 
			
		||||
    char		t_infomask;	/* whether tuple as null or variable
 | 
			
		||||
					 * length attributes
 | 
			
		||||
					 */
 | 
			
		||||
	char			t_infomask; /* whether tuple as null or variable
 | 
			
		||||
								 * length attributes */
 | 
			
		||||
 | 
			
		||||
    uint8		t_hoff;		/* sizeof tuple header */
 | 
			
		||||
	uint8			t_hoff;		/* sizeof tuple header */
 | 
			
		||||
 | 
			
		||||
    bits8		t_bits[MinHeapTupleBitmapSize / 8];
 | 
			
		||||
					/* bit map of domains */
 | 
			
		||||
	bits8			t_bits[MinHeapTupleBitmapSize / 8];
 | 
			
		||||
	/* bit map of domains */
 | 
			
		||||
 | 
			
		||||
    /* MORE DATA FOLLOWS AT END OF STRUCT */
 | 
			
		||||
} HeapTupleData;	
 | 
			
		||||
	/* MORE DATA FOLLOWS AT END OF STRUCT */
 | 
			
		||||
}				HeapTupleData;
 | 
			
		||||
 | 
			
		||||
typedef HeapTupleData	*HeapTuple;
 | 
			
		||||
typedef HeapTupleData *HeapTuple;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define SelfItemPointerAttributeNumber		(-1)
 | 
			
		||||
#define ObjectIdAttributeNumber			(-2)
 | 
			
		||||
#define MinTransactionIdAttributeNumber		(-3)
 | 
			
		||||
#define MinCommandIdAttributeNumber		(-4)
 | 
			
		||||
#define MaxTransactionIdAttributeNumber		(-5)
 | 
			
		||||
#define MaxCommandIdAttributeNumber		(-6)
 | 
			
		||||
#define ChainItemPointerAttributeNumber		(-7)
 | 
			
		||||
#define AnchorItemPointerAttributeNumber	(-8)
 | 
			
		||||
#define MinAbsoluteTimeAttributeNumber		(-9)
 | 
			
		||||
#define MaxAbsoluteTimeAttributeNumber		(-10)
 | 
			
		||||
#define VersionTypeAttributeNumber		(-11)
 | 
			
		||||
#define FirstLowInvalidHeapAttributeNumber	(-12)
 | 
			
		||||
#define SelfItemPointerAttributeNumber			(-1)
 | 
			
		||||
#define ObjectIdAttributeNumber					(-2)
 | 
			
		||||
#define MinTransactionIdAttributeNumber			(-3)
 | 
			
		||||
#define MinCommandIdAttributeNumber				(-4)
 | 
			
		||||
#define MaxTransactionIdAttributeNumber			(-5)
 | 
			
		||||
#define MaxCommandIdAttributeNumber				(-6)
 | 
			
		||||
#define ChainItemPointerAttributeNumber			(-7)
 | 
			
		||||
#define AnchorItemPointerAttributeNumber		(-8)
 | 
			
		||||
#define MinAbsoluteTimeAttributeNumber			(-9)
 | 
			
		||||
#define MaxAbsoluteTimeAttributeNumber			(-10)
 | 
			
		||||
#define VersionTypeAttributeNumber				(-11)
 | 
			
		||||
#define FirstLowInvalidHeapAttributeNumber		(-12)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	support macros
 | 
			
		||||
 *		support macros
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define GETSTRUCT(TUP) (((char *)(TUP)) + ((HeapTuple)(TUP))->t_hoff)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * BITMAPLEN(NATTS) - 
 | 
			
		||||
 *	Computes minimum size of bitmap given number of domains.
 | 
			
		||||
 * BITMAPLEN(NATTS) -
 | 
			
		||||
 *		Computes minimum size of bitmap given number of domains.
 | 
			
		||||
 */
 | 
			
		||||
#define BITMAPLEN(NATTS) \
 | 
			
		||||
	((((((int)(NATTS) - 1) >> 3) + 4 - (MinHeapTupleBitmapSize >> 3)) \
 | 
			
		||||
	  & ~03) + (MinHeapTupleBitmapSize >> 3))
 | 
			
		||||
		((((((int)(NATTS) - 1) >> 3) + 4 - (MinHeapTupleBitmapSize >> 3)) \
 | 
			
		||||
		  & ~03) + (MinHeapTupleBitmapSize >> 3))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * HeapTupleIsValid
 | 
			
		||||
 *	True iff the heap tuple is valid.
 | 
			
		||||
 *		True iff the heap tuple is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	HeapTupleIsValid(tuple)	PointerIsValid(tuple)
 | 
			
		||||
#define HeapTupleIsValid(tuple) PointerIsValid(tuple)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * information stored in t_infomask:
 | 
			
		||||
 */
 | 
			
		||||
#define HEAP_HASNULL		0x01	/* has null attribute(s) */
 | 
			
		||||
#define	HEAP_HASVARLENA		0x02	/* has variable length attribute(s) */
 | 
			
		||||
#define HEAP_HASNULL			0x01	/* has null attribute(s) */
 | 
			
		||||
#define HEAP_HASVARLENA			0x02	/* has variable length
 | 
			
		||||
										 * attribute(s) */
 | 
			
		||||
 | 
			
		||||
#define HeapTupleNoNulls(tuple) \
 | 
			
		||||
	(!(((HeapTuple) (tuple))->t_infomask & HEAP_HASNULL))
 | 
			
		||||
		(!(((HeapTuple) (tuple))->t_infomask & HEAP_HASNULL))
 | 
			
		||||
 | 
			
		||||
#define HeapTupleAllFixed(tuple) \
 | 
			
		||||
	(!(((HeapTuple) (tuple))->t_infomask & HEAP_HASVARLENA))
 | 
			
		||||
		(!(((HeapTuple) (tuple))->t_infomask & HEAP_HASVARLENA))
 | 
			
		||||
 | 
			
		||||
#endif	/* HTUP_H */
 | 
			
		||||
#endif							/* HTUP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +1,34 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * ibit.h--
 | 
			
		||||
 *    POSTGRES index valid attribute bit map definitions.
 | 
			
		||||
 *	  POSTGRES index valid attribute bit map definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: ibit.h,v 1.4 1996/11/05 07:24:03 scrappy Exp $
 | 
			
		||||
 * $Id: ibit.h,v 1.5 1997/09/07 04:56:01 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	IBIT_H
 | 
			
		||||
#ifndef IBIT_H
 | 
			
		||||
#define IBIT_H
 | 
			
		||||
 | 
			
		||||
#include <utils/memutils.h>
 | 
			
		||||
 | 
			
		||||
typedef struct IndexAttributeBitMapData {
 | 
			
		||||
	char	bits[(MaxIndexAttributeNumber + MaxBitsPerByte - 1)
 | 
			
		||||
		/ MaxBitsPerByte];
 | 
			
		||||
} IndexAttributeBitMapData;
 | 
			
		||||
typedef struct IndexAttributeBitMapData
 | 
			
		||||
{
 | 
			
		||||
	char			bits[(MaxIndexAttributeNumber + MaxBitsPerByte - 1)
 | 
			
		||||
						 /				 MaxBitsPerByte];
 | 
			
		||||
}				IndexAttributeBitMapData;
 | 
			
		||||
 | 
			
		||||
typedef IndexAttributeBitMapData	*IndexAttributeBitMap;
 | 
			
		||||
typedef IndexAttributeBitMapData *IndexAttributeBitMap;
 | 
			
		||||
 | 
			
		||||
#define IndexAttributeBitMapSize	sizeof(IndexAttributeBitMapData)
 | 
			
		||||
#define IndexAttributeBitMapSize		sizeof(IndexAttributeBitMapData)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IndexAttributeBitMapIsValid --
 | 
			
		||||
 *	True iff attribute bit map is valid.
 | 
			
		||||
 *		True iff attribute bit map is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	IndexAttributeBitMapIsValid(bits) PointerIsValid(bits)
 | 
			
		||||
#define IndexAttributeBitMapIsValid(bits) PointerIsValid(bits)
 | 
			
		||||
 | 
			
		||||
#endif	/* IBIT_H */
 | 
			
		||||
#endif							/* IBIT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * iqual.h--
 | 
			
		||||
 *    Index scan key qualification definitions.
 | 
			
		||||
 *	  Index scan key qualification definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: iqual.h,v 1.4 1996/11/05 10:37:03 scrappy Exp $
 | 
			
		||||
 * $Id: iqual.h,v 1.5 1997/09/07 04:56:04 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	IQUAL_H
 | 
			
		||||
#ifndef IQUAL_H
 | 
			
		||||
#define IQUAL_H
 | 
			
		||||
 | 
			
		||||
#include <access/skey.h>
 | 
			
		||||
@@ -18,13 +18,14 @@
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	index tuple qualification support
 | 
			
		||||
 *		index tuple qualification support
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
extern int NIndexTupleProcessed;
 | 
			
		||||
extern int		NIndexTupleProcessed;
 | 
			
		||||
 | 
			
		||||
extern bool index_keytest(IndexTuple tuple, TupleDesc tupdesc,
 | 
			
		||||
extern bool
 | 
			
		||||
index_keytest(IndexTuple tuple, TupleDesc tupdesc,
 | 
			
		||||
			  int scanKeySize, ScanKey key);
 | 
			
		||||
 | 
			
		||||
#endif	/* IQUAL_H */
 | 
			
		||||
#endif							/* IQUAL_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * istrat.h--
 | 
			
		||||
 *    POSTGRES index strategy definitions.
 | 
			
		||||
 *	  POSTGRES index strategy definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: istrat.h,v 1.5 1997/08/19 21:37:31 momjian Exp $
 | 
			
		||||
 * $Id: istrat.h,v 1.6 1997/09/07 04:56:05 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	ISTRAT_H
 | 
			
		||||
#ifndef ISTRAT_H
 | 
			
		||||
#define ISTRAT_H
 | 
			
		||||
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
@@ -18,51 +18,55 @@
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * StrategyNumberIsValid --
 | 
			
		||||
 *	True iff the strategy number is valid.
 | 
			
		||||
 *		True iff the strategy number is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define StrategyNumberIsValid(strategyNumber) \
 | 
			
		||||
    ((bool) ((strategyNumber) != InvalidStrategy))
 | 
			
		||||
	((bool) ((strategyNumber) != InvalidStrategy))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * StrategyNumberIsInBounds --
 | 
			
		||||
 *	True iff strategy number is within given bounds.
 | 
			
		||||
 *		True iff strategy number is within given bounds.
 | 
			
		||||
 *
 | 
			
		||||
 * Note:
 | 
			
		||||
 *	Assumes StrategyNumber is an unsigned type.
 | 
			
		||||
 *	Assumes the bounded interval to be (0,max].
 | 
			
		||||
 *		Assumes StrategyNumber is an unsigned type.
 | 
			
		||||
 *		Assumes the bounded interval to be (0,max].
 | 
			
		||||
 */
 | 
			
		||||
#define StrategyNumberIsInBounds(strategyNumber, maxStrategyNumber) \
 | 
			
		||||
    ((bool)(InvalidStrategy < (strategyNumber) && \
 | 
			
		||||
	    (strategyNumber) <= (maxStrategyNumber)))
 | 
			
		||||
	((bool)(InvalidStrategy < (strategyNumber) && \
 | 
			
		||||
			(strategyNumber) <= (maxStrategyNumber)))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * StrategyMapIsValid --
 | 
			
		||||
 *	True iff the index strategy mapping is valid.
 | 
			
		||||
 *		True iff the index strategy mapping is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	StrategyMapIsValid(map) PointerIsValid(map)
 | 
			
		||||
#define StrategyMapIsValid(map) PointerIsValid(map)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IndexStrategyIsValid --
 | 
			
		||||
 *	True iff the index strategy is valid.
 | 
			
		||||
 *		True iff the index strategy is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	IndexStrategyIsValid(s)	PointerIsValid(s)
 | 
			
		||||
#define IndexStrategyIsValid(s) PointerIsValid(s)
 | 
			
		||||
 | 
			
		||||
extern StrategyMap IndexStrategyGetStrategyMap(IndexStrategy indexStrategy,
 | 
			
		||||
	StrategyNumber maxStrategyNum, AttrNumber attrNum);
 | 
			
		||||
extern StrategyMap
 | 
			
		||||
IndexStrategyGetStrategyMap(IndexStrategy indexStrategy,
 | 
			
		||||
					  StrategyNumber maxStrategyNum, AttrNumber attrNum);
 | 
			
		||||
 | 
			
		||||
extern Size
 | 
			
		||||
extern			Size
 | 
			
		||||
AttributeNumberGetIndexStrategySize(AttrNumber maxAttributeNumber,
 | 
			
		||||
				    StrategyNumber maxStrategyNumber);
 | 
			
		||||
extern StrategyNumber RelationGetStrategy(Relation relation,
 | 
			
		||||
	AttrNumber attributeNumber, StrategyEvaluation evaluation,
 | 
			
		||||
	RegProcedure procedure);
 | 
			
		||||
extern bool RelationInvokeStrategy(Relation relation,
 | 
			
		||||
	StrategyEvaluation evaluation, AttrNumber attributeNumber,
 | 
			
		||||
	StrategyNumber strategy, Datum left, Datum right);
 | 
			
		||||
extern void IndexSupportInitialize(IndexStrategy indexStrategy,
 | 
			
		||||
	RegProcedure *indexSupport, Oid indexObjectId,
 | 
			
		||||
	Oid accessMethodObjectId, StrategyNumber maxStrategyNumber,
 | 
			
		||||
	StrategyNumber maxSupportNumber, AttrNumber maxAttributeNumber);
 | 
			
		||||
									StrategyNumber maxStrategyNumber);
 | 
			
		||||
extern StrategyNumber
 | 
			
		||||
RelationGetStrategy(Relation relation,
 | 
			
		||||
			   AttrNumber attributeNumber, StrategyEvaluation evaluation,
 | 
			
		||||
					RegProcedure procedure);
 | 
			
		||||
extern bool
 | 
			
		||||
RelationInvokeStrategy(Relation relation,
 | 
			
		||||
			   StrategyEvaluation evaluation, AttrNumber attributeNumber,
 | 
			
		||||
					   StrategyNumber strategy, Datum left, Datum right);
 | 
			
		||||
extern void
 | 
			
		||||
IndexSupportInitialize(IndexStrategy indexStrategy,
 | 
			
		||||
					   RegProcedure * indexSupport, Oid indexObjectId,
 | 
			
		||||
			  Oid accessMethodObjectId, StrategyNumber maxStrategyNumber,
 | 
			
		||||
		 StrategyNumber maxSupportNumber, AttrNumber maxAttributeNumber);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif	/* ISTRAT_H */
 | 
			
		||||
#endif							/* ISTRAT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * itup.h--
 | 
			
		||||
 *    POSTGRES index tuple definitions.
 | 
			
		||||
 *	  POSTGRES index tuple definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: itup.h,v 1.5 1997/08/19 21:37:33 momjian Exp $
 | 
			
		||||
 * $Id: itup.h,v 1.6 1997/09/07 04:56:05 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -16,69 +16,72 @@
 | 
			
		||||
#include <access/tupdesc.h>
 | 
			
		||||
#include <storage/itemptr.h>
 | 
			
		||||
 | 
			
		||||
#define MaxIndexAttributeNumber	7
 | 
			
		||||
#define MaxIndexAttributeNumber 7
 | 
			
		||||
 | 
			
		||||
typedef struct IndexTupleData {
 | 
			
		||||
    ItemPointerData		t_tid; /* reference TID to base tuple */
 | 
			
		||||
typedef struct IndexTupleData
 | 
			
		||||
{
 | 
			
		||||
	ItemPointerData t_tid;		/* reference TID to base tuple */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * t_info is layed out in the following fashion:
 | 
			
		||||
     *
 | 
			
		||||
     * 15th (leftmost) bit: "has nulls" bit
 | 
			
		||||
     * 14th bit: "has varlenas" bit
 | 
			
		||||
     * 13th bit: "has rules" bit - (removed ay 11/94)
 | 
			
		||||
     * bits 12-0 bit: size of tuple.
 | 
			
		||||
     */
 | 
			
		||||
	/*
 | 
			
		||||
	 * t_info is layed out in the following fashion:
 | 
			
		||||
	 *
 | 
			
		||||
	 * 15th (leftmost) bit: "has nulls" bit 14th bit: "has varlenas" bit 13th
 | 
			
		||||
	 * bit: "has rules" bit - (removed ay 11/94) bits 12-0 bit: size of
 | 
			
		||||
	 * tuple.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
    unsigned short		t_info; /* various info about tuple */
 | 
			
		||||
	unsigned short	t_info;		/* various info about tuple */
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * please make sure sizeof(IndexTupleData) is MAXALIGN'ed.
 | 
			
		||||
     * See IndexInfoFindDataOffset() for the reason.
 | 
			
		||||
     */
 | 
			
		||||
    
 | 
			
		||||
} IndexTupleData;		/* MORE DATA FOLLOWS AT END OF STRUCT */
 | 
			
		||||
	/*
 | 
			
		||||
	 * please make sure sizeof(IndexTupleData) is MAXALIGN'ed. See
 | 
			
		||||
	 * IndexInfoFindDataOffset() for the reason.
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
typedef IndexTupleData	*IndexTuple;
 | 
			
		||||
}				IndexTupleData; /* MORE DATA FOLLOWS AT END OF STRUCT */
 | 
			
		||||
 | 
			
		||||
typedef IndexTupleData *IndexTuple;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct InsertIndexResultData {
 | 
			
		||||
    ItemPointerData	pointerData;
 | 
			
		||||
} InsertIndexResultData;
 | 
			
		||||
typedef struct InsertIndexResultData
 | 
			
		||||
{
 | 
			
		||||
	ItemPointerData pointerData;
 | 
			
		||||
}				InsertIndexResultData;
 | 
			
		||||
 | 
			
		||||
typedef InsertIndexResultData *InsertIndexResult;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct RetrieveIndexResultData {
 | 
			
		||||
    ItemPointerData	index_iptr;
 | 
			
		||||
    ItemPointerData	heap_iptr;
 | 
			
		||||
} RetrieveIndexResultData;
 | 
			
		||||
typedef struct RetrieveIndexResultData
 | 
			
		||||
{
 | 
			
		||||
	ItemPointerData index_iptr;
 | 
			
		||||
	ItemPointerData heap_iptr;
 | 
			
		||||
}				RetrieveIndexResultData;
 | 
			
		||||
 | 
			
		||||
typedef RetrieveIndexResultData	*RetrieveIndexResult;
 | 
			
		||||
typedef RetrieveIndexResultData *RetrieveIndexResult;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*-----------------
 | 
			
		||||
 * PredInfo -
 | 
			
		||||
 *    used for partial indices
 | 
			
		||||
 *	  used for partial indices
 | 
			
		||||
 *-----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct PredInfo {
 | 
			
		||||
    Node		*pred;
 | 
			
		||||
    Node		*oldPred;
 | 
			
		||||
} PredInfo;
 | 
			
		||||
typedef struct PredInfo
 | 
			
		||||
{
 | 
			
		||||
	Node		   *pred;
 | 
			
		||||
	Node		   *oldPred;
 | 
			
		||||
}				PredInfo;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	externs 
 | 
			
		||||
 *		externs
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define INDEX_SIZE_MASK 0x1FFF
 | 
			
		||||
#define INDEX_NULL_MASK 0x8000
 | 
			
		||||
#define INDEX_VAR_MASK  0x4000
 | 
			
		||||
#define INDEX_VAR_MASK	0x4000
 | 
			
		||||
 | 
			
		||||
#define IndexTupleSize(itup)       (((IndexTuple) (itup))->t_info & 0x1FFF)
 | 
			
		||||
#define IndexTupleDSize(itup)                      ((itup).t_info & 0x1FFF)
 | 
			
		||||
#define IndexTupleSize(itup)	   (((IndexTuple) (itup))->t_info & 0x1FFF)
 | 
			
		||||
#define IndexTupleDSize(itup)					   ((itup).t_info & 0x1FFF)
 | 
			
		||||
#define IndexTupleNoNulls(itup)  (!(((IndexTuple) (itup))->t_info & 0x8000))
 | 
			
		||||
#define IndexTupleAllFixed(itup) (!(((IndexTuple) (itup))->t_info & 0x4000))
 | 
			
		||||
 | 
			
		||||
@@ -86,15 +89,16 @@ typedef struct PredInfo {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* indextuple.h */
 | 
			
		||||
extern IndexTuple index_formtuple(TupleDesc tupleDescriptor,
 | 
			
		||||
				  Datum value[], char null[]);
 | 
			
		||||
extern Datum index_getattr(IndexTuple tuple, AttrNumber attNum,
 | 
			
		||||
	TupleDesc tupDesc, bool *isNullOutP);
 | 
			
		||||
extern RetrieveIndexResult
 | 
			
		||||
extern IndexTuple
 | 
			
		||||
index_formtuple(TupleDesc tupleDescriptor,
 | 
			
		||||
				Datum value[], char null[]);
 | 
			
		||||
extern Datum
 | 
			
		||||
index_getattr(IndexTuple tuple, AttrNumber attNum,
 | 
			
		||||
			  TupleDesc tupDesc, bool * isNullOutP);
 | 
			
		||||
extern			RetrieveIndexResult
 | 
			
		||||
FormRetrieveIndexResult(ItemPointer indexItemPointer,
 | 
			
		||||
			ItemPointer heapItemPointer);
 | 
			
		||||
extern void CopyIndexTuple(IndexTuple source, IndexTuple *target);
 | 
			
		||||
						ItemPointer heapItemPointer);
 | 
			
		||||
extern void		CopyIndexTuple(IndexTuple source, IndexTuple * target);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif	/* ITUP_H */
 | 
			
		||||
 | 
			
		||||
#endif							/* ITUP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nbtree.h--
 | 
			
		||||
 *    header file for postgres btree access method implementation.
 | 
			
		||||
 *	  header file for postgres btree access method implementation.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nbtree.h,v 1.14 1997/08/19 21:37:35 momjian Exp $
 | 
			
		||||
 * $Id: nbtree.h,v 1.15 1997/09/07 04:56:06 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NBTREE_H
 | 
			
		||||
#define	NBTREE_H
 | 
			
		||||
#ifndef NBTREE_H
 | 
			
		||||
#define NBTREE_H
 | 
			
		||||
 | 
			
		||||
#include <access/sdir.h>
 | 
			
		||||
#include <access/relscan.h>
 | 
			
		||||
@@ -23,184 +23,189 @@
 | 
			
		||||
#include <storage/itemptr.h>
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  BTPageOpaqueData -- At the end of every page, we store a pointer
 | 
			
		||||
 *  to both siblings in the tree.  See Lehman and Yao's paper for more
 | 
			
		||||
 *  info.  In addition, we need to know what sort of page this is
 | 
			
		||||
 *  (leaf or internal), and whether the page is available for reuse.
 | 
			
		||||
 *	BTPageOpaqueData -- At the end of every page, we store a pointer
 | 
			
		||||
 *	to both siblings in the tree.  See Lehman and Yao's paper for more
 | 
			
		||||
 *	info.  In addition, we need to know what sort of page this is
 | 
			
		||||
 *	(leaf or internal), and whether the page is available for reuse.
 | 
			
		||||
 *
 | 
			
		||||
 *  Lehman and Yao's algorithm requires a ``high key'' on every page.
 | 
			
		||||
 *  The high key on a page is guaranteed to be greater than or equal
 | 
			
		||||
 *  to any key that appears on this page.  Our insertion algorithm
 | 
			
		||||
 *  guarantees that we can use the initial least key on our right
 | 
			
		||||
 *  sibling as the high key.  We allocate space for the line pointer
 | 
			
		||||
 *  to the high key in the opaque data at the end of the page.
 | 
			
		||||
 *	Lehman and Yao's algorithm requires a ``high key'' on every page.
 | 
			
		||||
 *	The high key on a page is guaranteed to be greater than or equal
 | 
			
		||||
 *	to any key that appears on this page.  Our insertion algorithm
 | 
			
		||||
 *	guarantees that we can use the initial least key on our right
 | 
			
		||||
 *	sibling as the high key.  We allocate space for the line pointer
 | 
			
		||||
 *	to the high key in the opaque data at the end of the page.
 | 
			
		||||
 *
 | 
			
		||||
 *  Rightmost pages in the tree have no high key.
 | 
			
		||||
 *	Rightmost pages in the tree have no high key.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct BTPageOpaqueData {
 | 
			
		||||
    BlockNumber	btpo_prev;
 | 
			
		||||
    BlockNumber	btpo_next;
 | 
			
		||||
    uint16	btpo_flags;
 | 
			
		||||
typedef struct BTPageOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	BlockNumber		btpo_prev;
 | 
			
		||||
	BlockNumber		btpo_next;
 | 
			
		||||
	uint16			btpo_flags;
 | 
			
		||||
 | 
			
		||||
#define BTP_LEAF	(1 << 0)
 | 
			
		||||
#define BTP_ROOT	(1 << 1)
 | 
			
		||||
#define BTP_FREE	(1 << 2)
 | 
			
		||||
#define BTP_META	(1 << 3)
 | 
			
		||||
#define BTP_CHAIN	(1 << 4)
 | 
			
		||||
#define BTP_LEAF		(1 << 0)
 | 
			
		||||
#define BTP_ROOT		(1 << 1)
 | 
			
		||||
#define BTP_FREE		(1 << 2)
 | 
			
		||||
#define BTP_META		(1 << 3)
 | 
			
		||||
#define BTP_CHAIN		(1 << 4)
 | 
			
		||||
 | 
			
		||||
} BTPageOpaqueData;
 | 
			
		||||
}				BTPageOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef BTPageOpaqueData	*BTPageOpaque;
 | 
			
		||||
typedef BTPageOpaqueData *BTPageOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  ScanOpaqueData is used to remember which buffers we're currently
 | 
			
		||||
 *  examining in the scan.  We keep these buffers locked and pinned
 | 
			
		||||
 *  and recorded in the opaque entry of the scan in order to avoid
 | 
			
		||||
 *  doing a ReadBuffer() for every tuple in the index.  This avoids
 | 
			
		||||
 *  semop() calls, which are expensive.
 | 
			
		||||
 *	ScanOpaqueData is used to remember which buffers we're currently
 | 
			
		||||
 *	examining in the scan.	We keep these buffers locked and pinned
 | 
			
		||||
 *	and recorded in the opaque entry of the scan in order to avoid
 | 
			
		||||
 *	doing a ReadBuffer() for every tuple in the index.	This avoids
 | 
			
		||||
 *	semop() calls, which are expensive.
 | 
			
		||||
 *
 | 
			
		||||
 *  And it's used to remember actual scankey info (we need in it
 | 
			
		||||
 *  if some scankeys evaled at runtime.
 | 
			
		||||
 *	And it's used to remember actual scankey info (we need in it
 | 
			
		||||
 *	if some scankeys evaled at runtime.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct BTScanOpaqueData {
 | 
			
		||||
    Buffer	btso_curbuf;
 | 
			
		||||
    Buffer	btso_mrkbuf;
 | 
			
		||||
    uint16	qual_ok;		/* 0 for quals like key == 1 && key > 2 */
 | 
			
		||||
    uint16	numberOfKeys;		/* number of keys */
 | 
			
		||||
    uint16	numberOfFirstKeys;	/* number of keys for 1st attribute */
 | 
			
		||||
    ScanKey	keyData;		/* key descriptor */
 | 
			
		||||
} BTScanOpaqueData;
 | 
			
		||||
typedef struct BTScanOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	Buffer			btso_curbuf;
 | 
			
		||||
	Buffer			btso_mrkbuf;
 | 
			
		||||
	uint16			qual_ok;	/* 0 for quals like key == 1 && key > 2 */
 | 
			
		||||
	uint16			numberOfKeys;		/* number of keys */
 | 
			
		||||
	uint16			numberOfFirstKeys;	/* number of keys for 1st
 | 
			
		||||
										 * attribute */
 | 
			
		||||
	ScanKey			keyData;	/* key descriptor */
 | 
			
		||||
}				BTScanOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef BTScanOpaqueData	*BTScanOpaque;
 | 
			
		||||
typedef BTScanOpaqueData *BTScanOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  BTItems are what we store in the btree.  Each item has an index
 | 
			
		||||
 *  tuple, including key and pointer values.  In addition, we must
 | 
			
		||||
 *  guarantee that all tuples in the index are unique, in order to
 | 
			
		||||
 *  satisfy some assumptions in Lehman and Yao.  The way that we do
 | 
			
		||||
 *  this is by generating a new OID for every insertion that we do in
 | 
			
		||||
 *  the tree.  This adds eight bytes to the size of btree index
 | 
			
		||||
 *  tuples.  Note that we do not use the OID as part of a composite
 | 
			
		||||
 *  key; the OID only serves as a unique identifier for a given index
 | 
			
		||||
 *  tuple (logical position within a page).
 | 
			
		||||
 *	BTItems are what we store in the btree.  Each item has an index
 | 
			
		||||
 *	tuple, including key and pointer values.  In addition, we must
 | 
			
		||||
 *	guarantee that all tuples in the index are unique, in order to
 | 
			
		||||
 *	satisfy some assumptions in Lehman and Yao.  The way that we do
 | 
			
		||||
 *	this is by generating a new OID for every insertion that we do in
 | 
			
		||||
 *	the tree.  This adds eight bytes to the size of btree index
 | 
			
		||||
 *	tuples.  Note that we do not use the OID as part of a composite
 | 
			
		||||
 *	key; the OID only serves as a unique identifier for a given index
 | 
			
		||||
 *	tuple (logical position within a page).
 | 
			
		||||
 *
 | 
			
		||||
 *  New comments: 
 | 
			
		||||
 *  actually, we must guarantee that all tuples in A LEVEL
 | 
			
		||||
 *  are unique, not in ALL INDEX. So, we can use bti_itup->t_tid
 | 
			
		||||
 *  as unique identifier for a given index tuple (logical position 
 | 
			
		||||
 *  within a level).	- vadim 04/09/97
 | 
			
		||||
 *	New comments:
 | 
			
		||||
 *	actually, we must guarantee that all tuples in A LEVEL
 | 
			
		||||
 *	are unique, not in ALL INDEX. So, we can use bti_itup->t_tid
 | 
			
		||||
 *	as unique identifier for a given index tuple (logical position
 | 
			
		||||
 *	within a level).	- vadim 04/09/97
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct BTItemData {
 | 
			
		||||
typedef struct BTItemData
 | 
			
		||||
{
 | 
			
		||||
#ifndef BTREE_VERSION_1
 | 
			
		||||
    Oid				bti_oid;
 | 
			
		||||
    int32			bti_dummy;	/* padding to make bti_itup
 | 
			
		||||
						 * align at 8-byte boundary
 | 
			
		||||
						 */
 | 
			
		||||
	Oid				bti_oid;
 | 
			
		||||
	int32			bti_dummy;	/* padding to make bti_itup align at
 | 
			
		||||
								 * 8-byte boundary */
 | 
			
		||||
#endif
 | 
			
		||||
    IndexTupleData		bti_itup;
 | 
			
		||||
} BTItemData;
 | 
			
		||||
	IndexTupleData	bti_itup;
 | 
			
		||||
}				BTItemData;
 | 
			
		||||
 | 
			
		||||
typedef BTItemData	*BTItem;
 | 
			
		||||
typedef BTItemData *BTItem;
 | 
			
		||||
 | 
			
		||||
#ifdef BTREE_VERSION_1
 | 
			
		||||
#define BTItemSame(i1, i2)    ( i1->bti_itup.t_tid.ip_blkid.bi_hi == \
 | 
			
		||||
				i2->bti_itup.t_tid.ip_blkid.bi_hi && \
 | 
			
		||||
				i1->bti_itup.t_tid.ip_blkid.bi_lo == \
 | 
			
		||||
				i2->bti_itup.t_tid.ip_blkid.bi_lo && \
 | 
			
		||||
				i1->bti_itup.t_tid.ip_posid == \
 | 
			
		||||
				i2->bti_itup.t_tid.ip_posid )
 | 
			
		||||
#define BTItemSame(i1, i2)	  ( i1->bti_itup.t_tid.ip_blkid.bi_hi == \
 | 
			
		||||
								i2->bti_itup.t_tid.ip_blkid.bi_hi && \
 | 
			
		||||
								i1->bti_itup.t_tid.ip_blkid.bi_lo == \
 | 
			
		||||
								i2->bti_itup.t_tid.ip_blkid.bi_lo && \
 | 
			
		||||
								i1->bti_itup.t_tid.ip_posid == \
 | 
			
		||||
								i2->bti_itup.t_tid.ip_posid )
 | 
			
		||||
#else
 | 
			
		||||
#define BTItemSame(i1, i2)    ( i1->bti_oid == i2->bti_oid )
 | 
			
		||||
#define BTItemSame(i1, i2)	  ( i1->bti_oid == i2->bti_oid )
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  BTStackData -- As we descend a tree, we push the (key, pointer)
 | 
			
		||||
 *  pairs from internal nodes onto a private stack.  If we split a
 | 
			
		||||
 *  leaf, we use this stack to walk back up the tree and insert data
 | 
			
		||||
 *  into parent nodes (and possibly to split them, too).  Lehman and
 | 
			
		||||
 *  Yao's update algorithm guarantees that under no circumstances can
 | 
			
		||||
 *  our private stack give us an irredeemably bad picture up the tree.
 | 
			
		||||
 *  Again, see the paper for details.
 | 
			
		||||
 *	BTStackData -- As we descend a tree, we push the (key, pointer)
 | 
			
		||||
 *	pairs from internal nodes onto a private stack.  If we split a
 | 
			
		||||
 *	leaf, we use this stack to walk back up the tree and insert data
 | 
			
		||||
 *	into parent nodes (and possibly to split them, too).  Lehman and
 | 
			
		||||
 *	Yao's update algorithm guarantees that under no circumstances can
 | 
			
		||||
 *	our private stack give us an irredeemably bad picture up the tree.
 | 
			
		||||
 *	Again, see the paper for details.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct BTStackData {
 | 
			
		||||
    BlockNumber		bts_blkno;
 | 
			
		||||
    OffsetNumber	bts_offset;
 | 
			
		||||
    BTItem		bts_btitem;
 | 
			
		||||
    struct BTStackData	*bts_parent;
 | 
			
		||||
} BTStackData;
 | 
			
		||||
typedef struct BTStackData
 | 
			
		||||
{
 | 
			
		||||
	BlockNumber		bts_blkno;
 | 
			
		||||
	OffsetNumber	bts_offset;
 | 
			
		||||
	BTItem			bts_btitem;
 | 
			
		||||
	struct BTStackData *bts_parent;
 | 
			
		||||
}				BTStackData;
 | 
			
		||||
 | 
			
		||||
typedef BTStackData	*BTStack;
 | 
			
		||||
typedef BTStackData *BTStack;
 | 
			
		||||
 | 
			
		||||
typedef struct BTPageState {
 | 
			
		||||
    Buffer		btps_buf;
 | 
			
		||||
    Page		btps_page;
 | 
			
		||||
    BTItem		btps_lastbti;
 | 
			
		||||
    OffsetNumber	btps_lastoff;
 | 
			
		||||
    OffsetNumber	btps_firstoff;
 | 
			
		||||
    int			btps_level;
 | 
			
		||||
    bool		btps_doupper;
 | 
			
		||||
    struct BTPageState	*btps_next;
 | 
			
		||||
} BTPageState;
 | 
			
		||||
typedef struct BTPageState
 | 
			
		||||
{
 | 
			
		||||
	Buffer			btps_buf;
 | 
			
		||||
	Page			btps_page;
 | 
			
		||||
	BTItem			btps_lastbti;
 | 
			
		||||
	OffsetNumber	btps_lastoff;
 | 
			
		||||
	OffsetNumber	btps_firstoff;
 | 
			
		||||
	int				btps_level;
 | 
			
		||||
	bool			btps_doupper;
 | 
			
		||||
	struct BTPageState *btps_next;
 | 
			
		||||
}				BTPageState;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  We need to be able to tell the difference between read and write
 | 
			
		||||
 *  requests for pages, in order to do locking correctly.
 | 
			
		||||
 *	We need to be able to tell the difference between read and write
 | 
			
		||||
 *	requests for pages, in order to do locking correctly.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	BT_READ		0
 | 
			
		||||
#define	BT_WRITE	1
 | 
			
		||||
#define BT_READ			0
 | 
			
		||||
#define BT_WRITE		1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  Similarly, the difference between insertion and non-insertion binary
 | 
			
		||||
 *  searches on a given page makes a difference when we're descending the
 | 
			
		||||
 *  tree.
 | 
			
		||||
 *	Similarly, the difference between insertion and non-insertion binary
 | 
			
		||||
 *	searches on a given page makes a difference when we're descending the
 | 
			
		||||
 *	tree.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define BT_INSERTION	0
 | 
			
		||||
#define BT_DESCENT	1
 | 
			
		||||
#define BT_DESCENT		1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  We must classify index modification types for the benefit of
 | 
			
		||||
 *  _bt_adjscans.
 | 
			
		||||
 *	We must classify index modification types for the benefit of
 | 
			
		||||
 *	_bt_adjscans.
 | 
			
		||||
 */
 | 
			
		||||
#define BT_INSERT	0
 | 
			
		||||
#define	BT_DELETE	1
 | 
			
		||||
#define BT_INSERT		0
 | 
			
		||||
#define BT_DELETE		1
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  In general, the btree code tries to localize its knowledge about
 | 
			
		||||
 *  page layout to a couple of routines.  However, we need a special
 | 
			
		||||
 *  value to indicate "no page number" in those places where we expect
 | 
			
		||||
 *  page numbers.
 | 
			
		||||
 *	In general, the btree code tries to localize its knowledge about
 | 
			
		||||
 *	page layout to a couple of routines.  However, we need a special
 | 
			
		||||
 *	value to indicate "no page number" in those places where we expect
 | 
			
		||||
 *	page numbers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define P_NONE		0
 | 
			
		||||
#define	P_LEFTMOST(opaque)	((opaque)->btpo_prev == P_NONE)
 | 
			
		||||
#define	P_RIGHTMOST(opaque)	((opaque)->btpo_next == P_NONE)
 | 
			
		||||
#define P_NONE			0
 | 
			
		||||
#define P_LEFTMOST(opaque)		((opaque)->btpo_prev == P_NONE)
 | 
			
		||||
#define P_RIGHTMOST(opaque)		((opaque)->btpo_next == P_NONE)
 | 
			
		||||
 | 
			
		||||
#define	P_HIKEY		((OffsetNumber) 1)
 | 
			
		||||
#define	P_FIRSTKEY	((OffsetNumber) 2)
 | 
			
		||||
#define P_HIKEY			((OffsetNumber) 1)
 | 
			
		||||
#define P_FIRSTKEY		((OffsetNumber) 2)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  Strategy numbers -- ordering of these is <, <=, =, >=, > 
 | 
			
		||||
 *	Strategy numbers -- ordering of these is <, <=, =, >=, >
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define BTLessStrategyNumber		1
 | 
			
		||||
#define BTLessEqualStrategyNumber	2
 | 
			
		||||
#define BTEqualStrategyNumber		3
 | 
			
		||||
#define BTLessStrategyNumber			1
 | 
			
		||||
#define BTLessEqualStrategyNumber		2
 | 
			
		||||
#define BTEqualStrategyNumber			3
 | 
			
		||||
#define BTGreaterEqualStrategyNumber	4
 | 
			
		||||
#define BTGreaterStrategyNumber		5
 | 
			
		||||
#define BTMaxStrategyNumber		5
 | 
			
		||||
#define BTGreaterStrategyNumber			5
 | 
			
		||||
#define BTMaxStrategyNumber				5
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When a new operator class is declared, we require that the user
 | 
			
		||||
 *  supply us with an amproc procedure for determining whether, for
 | 
			
		||||
 *  two keys a and b, a < b, a = b, or a > b.  This routine must
 | 
			
		||||
 *  return < 0, 0, > 0, respectively, in these three cases.  Since we
 | 
			
		||||
 *  only have one such proc in amproc, it's number 1.
 | 
			
		||||
 *	When a new operator class is declared, we require that the user
 | 
			
		||||
 *	supply us with an amproc procedure for determining whether, for
 | 
			
		||||
 *	two keys a and b, a < b, a = b, or a > b.  This routine must
 | 
			
		||||
 *	return < 0, 0, > 0, respectively, in these three cases.  Since we
 | 
			
		||||
 *	only have one such proc in amproc, it's number 1.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define BTORDER_PROC	1
 | 
			
		||||
@@ -208,94 +213,105 @@ typedef struct BTPageState {
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtinsert.c
 | 
			
		||||
 */
 | 
			
		||||
extern InsertIndexResult _bt_doinsert(Relation rel, BTItem btitem,
 | 
			
		||||
				      bool index_is_unique, Relation heapRel);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
_bt_doinsert(Relation rel, BTItem btitem,
 | 
			
		||||
			 bool index_is_unique, Relation heapRel);
 | 
			
		||||
 | 
			
		||||
				/* default is to allow duplicates */
 | 
			
		||||
extern bool _bt_itemcmp(Relation rel, Size keysz, BTItem item1, BTItem item2,
 | 
			
		||||
 /* default is to allow duplicates */
 | 
			
		||||
extern bool
 | 
			
		||||
_bt_itemcmp(Relation rel, Size keysz, BTItem item1, BTItem item2,
 | 
			
		||||
			StrategyNumber strat);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtpage.c
 | 
			
		||||
 */
 | 
			
		||||
extern void _bt_metapinit(Relation rel);
 | 
			
		||||
extern Buffer _bt_getroot(Relation rel, int access);
 | 
			
		||||
extern Buffer _bt_getbuf(Relation rel, BlockNumber blkno, int access);
 | 
			
		||||
extern void _bt_relbuf(Relation rel, Buffer buf, int access);
 | 
			
		||||
extern void _bt_wrtbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void _bt_wrtnorelbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void _bt_pageinit(Page page, Size size);
 | 
			
		||||
extern void _bt_metaproot(Relation rel, BlockNumber rootbknum, int level);
 | 
			
		||||
extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access);
 | 
			
		||||
extern void _bt_pagedel(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void		_bt_metapinit(Relation rel);
 | 
			
		||||
extern Buffer	_bt_getroot(Relation rel, int access);
 | 
			
		||||
extern Buffer	_bt_getbuf(Relation rel, BlockNumber blkno, int access);
 | 
			
		||||
extern void		_bt_relbuf(Relation rel, Buffer buf, int access);
 | 
			
		||||
extern void		_bt_wrtbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void		_bt_wrtnorelbuf(Relation rel, Buffer buf);
 | 
			
		||||
extern void		_bt_pageinit(Page page, Size size);
 | 
			
		||||
extern void		_bt_metaproot(Relation rel, BlockNumber rootbknum, int level);
 | 
			
		||||
extern Buffer	_bt_getstackbuf(Relation rel, BTStack stack, int access);
 | 
			
		||||
extern void		_bt_pagedel(Relation rel, ItemPointer tid);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtree.c
 | 
			
		||||
 */
 | 
			
		||||
extern bool BuildingBtree;	/* in nbtree.c */
 | 
			
		||||
extern bool		BuildingBtree;	/* in nbtree.c */
 | 
			
		||||
 | 
			
		||||
extern void btbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
	AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
	Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
 | 
			
		||||
extern InsertIndexResult btinsert(Relation rel, Datum *datum, char *nulls,
 | 
			
		||||
				  ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char *btgettuple(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern char *btbeginscan(Relation rel, bool fromEnd, uint16 keysz,
 | 
			
		||||
			 ScanKey scankey);
 | 
			
		||||
extern void
 | 
			
		||||
btbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
		AttrNumber * attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
		Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
btinsert(Relation rel, Datum * datum, char *nulls,
 | 
			
		||||
		 ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char    *btgettuple(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern char    *
 | 
			
		||||
btbeginscan(Relation rel, bool fromEnd, uint16 keysz,
 | 
			
		||||
			ScanKey scankey);
 | 
			
		||||
 | 
			
		||||
extern void btrescan(IndexScanDesc scan, bool fromEnd, ScanKey scankey);
 | 
			
		||||
extern void btmovescan(IndexScanDesc scan, Datum v);
 | 
			
		||||
extern void btendscan(IndexScanDesc scan);
 | 
			
		||||
extern void btmarkpos(IndexScanDesc scan);
 | 
			
		||||
extern void btrestrpos(IndexScanDesc scan);
 | 
			
		||||
extern void btdelete(Relation rel, ItemPointer tid);
 | 
			
		||||
extern void		btrescan(IndexScanDesc scan, bool fromEnd, ScanKey scankey);
 | 
			
		||||
extern void		btmovescan(IndexScanDesc scan, Datum v);
 | 
			
		||||
extern void		btendscan(IndexScanDesc scan);
 | 
			
		||||
extern void		btmarkpos(IndexScanDesc scan);
 | 
			
		||||
extern void		btrestrpos(IndexScanDesc scan);
 | 
			
		||||
extern void		btdelete(Relation rel, ItemPointer tid);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtscan.c
 | 
			
		||||
 */
 | 
			
		||||
extern void _bt_regscan(IndexScanDesc scan);
 | 
			
		||||
extern void _bt_dropscan(IndexScanDesc scan);
 | 
			
		||||
extern void _bt_adjscans(Relation rel, ItemPointer tid, int op);
 | 
			
		||||
extern void		_bt_regscan(IndexScanDesc scan);
 | 
			
		||||
extern void		_bt_dropscan(IndexScanDesc scan);
 | 
			
		||||
extern void		_bt_adjscans(Relation rel, ItemPointer tid, int op);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtsearch.c
 | 
			
		||||
 */
 | 
			
		||||
extern BTStack _bt_search(Relation rel, int keysz, ScanKey scankey,
 | 
			
		||||
			  Buffer *bufP);
 | 
			
		||||
extern Buffer _bt_moveright(Relation rel, Buffer buf, int keysz,
 | 
			
		||||
			    ScanKey scankey, int access);
 | 
			
		||||
extern bool _bt_skeycmp(Relation rel, Size keysz, ScanKey scankey,
 | 
			
		||||
extern BTStack
 | 
			
		||||
_bt_search(Relation rel, int keysz, ScanKey scankey,
 | 
			
		||||
		   Buffer * bufP);
 | 
			
		||||
extern Buffer
 | 
			
		||||
_bt_moveright(Relation rel, Buffer buf, int keysz,
 | 
			
		||||
			  ScanKey scankey, int access);
 | 
			
		||||
extern bool
 | 
			
		||||
_bt_skeycmp(Relation rel, Size keysz, ScanKey scankey,
 | 
			
		||||
			Page page, ItemId itemid, StrategyNumber strat);
 | 
			
		||||
extern OffsetNumber _bt_binsrch(Relation rel, Buffer buf, int keysz,
 | 
			
		||||
				ScanKey scankey, int srchtype);
 | 
			
		||||
extern OffsetNumber
 | 
			
		||||
_bt_binsrch(Relation rel, Buffer buf, int keysz,
 | 
			
		||||
			ScanKey scankey, int srchtype);
 | 
			
		||||
extern RetrieveIndexResult _bt_next(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern RetrieveIndexResult _bt_first(IndexScanDesc scan, ScanDirection dir);
 | 
			
		||||
extern bool _bt_step(IndexScanDesc scan, Buffer *bufP, ScanDirection dir);
 | 
			
		||||
extern bool		_bt_step(IndexScanDesc scan, Buffer * bufP, ScanDirection dir);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtstrat.c
 | 
			
		||||
 */
 | 
			
		||||
extern StrategyNumber _bt_getstrat(Relation rel, AttrNumber attno,
 | 
			
		||||
				   RegProcedure proc);
 | 
			
		||||
extern bool _bt_invokestrat(Relation rel, AttrNumber attno,
 | 
			
		||||
			    StrategyNumber strat, Datum left, Datum right);
 | 
			
		||||
extern StrategyNumber
 | 
			
		||||
_bt_getstrat(Relation rel, AttrNumber attno,
 | 
			
		||||
			 RegProcedure proc);
 | 
			
		||||
extern bool
 | 
			
		||||
_bt_invokestrat(Relation rel, AttrNumber attno,
 | 
			
		||||
				StrategyNumber strat, Datum left, Datum right);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtutils.c
 | 
			
		||||
 */
 | 
			
		||||
extern ScanKey  _bt_mkscankey(Relation rel, IndexTuple itup);
 | 
			
		||||
extern void _bt_freeskey(ScanKey skey);
 | 
			
		||||
extern void _bt_freestack(BTStack stack);
 | 
			
		||||
extern void _bt_orderkeys(Relation relation, BTScanOpaque so);
 | 
			
		||||
extern bool _bt_checkkeys (IndexScanDesc scan, IndexTuple tuple, Size *keysok);
 | 
			
		||||
extern BTItem _bt_formitem(IndexTuple itup);
 | 
			
		||||
extern ScanKey	_bt_mkscankey(Relation rel, IndexTuple itup);
 | 
			
		||||
extern void		_bt_freeskey(ScanKey skey);
 | 
			
		||||
extern void		_bt_freestack(BTStack stack);
 | 
			
		||||
extern void		_bt_orderkeys(Relation relation, BTScanOpaque so);
 | 
			
		||||
extern bool		_bt_checkkeys(IndexScanDesc scan, IndexTuple tuple, Size * keysok);
 | 
			
		||||
extern BTItem	_bt_formitem(IndexTuple itup);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in nbtsort.c
 | 
			
		||||
 */
 | 
			
		||||
extern void *_bt_spoolinit(Relation index, int ntapes, bool isunique);
 | 
			
		||||
extern void _bt_spooldestroy(void *spool);
 | 
			
		||||
extern void _bt_spool(Relation index, BTItem btitem, void *spool);
 | 
			
		||||
extern void _bt_leafbuild(Relation index, void *spool);
 | 
			
		||||
extern void    *_bt_spoolinit(Relation index, int ntapes, bool isunique);
 | 
			
		||||
extern void		_bt_spooldestroy(void *spool);
 | 
			
		||||
extern void		_bt_spool(Relation index, BTItem btitem, void *spool);
 | 
			
		||||
extern void		_bt_leafbuild(Relation index, void *spool);
 | 
			
		||||
 | 
			
		||||
#endif	/* NBTREE_H */
 | 
			
		||||
#endif							/* NBTREE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +1,26 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * printtup.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: printtup.h,v 1.2 1996/11/06 08:52:04 scrappy Exp $
 | 
			
		||||
 * $Id: printtup.h,v 1.3 1997/09/07 04:56:07 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	PRINTTUP_H
 | 
			
		||||
#ifndef PRINTTUP_H
 | 
			
		||||
#define PRINTTUP_H
 | 
			
		||||
 | 
			
		||||
#include <access/htup.h>
 | 
			
		||||
#include <access/tupdesc.h>
 | 
			
		||||
 | 
			
		||||
extern Oid typtoout(Oid type);
 | 
			
		||||
extern void printtup(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern void showatts(char *name, TupleDesc attinfo);
 | 
			
		||||
extern void debugtup(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern void printtup_internal(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern Oid gettypelem(Oid type);
 | 
			
		||||
extern Oid		typtoout(Oid type);
 | 
			
		||||
extern void		printtup(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern void		showatts(char *name, TupleDesc attinfo);
 | 
			
		||||
extern void		debugtup(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern void		printtup_internal(HeapTuple tuple, TupleDesc typeinfo);
 | 
			
		||||
extern Oid		gettypelem(Oid type);
 | 
			
		||||
 | 
			
		||||
#endif	/* PRINTTUP_H */
 | 
			
		||||
#endif							/* PRINTTUP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,80 +1,82 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * relscan.h--
 | 
			
		||||
 *    POSTGRES internal relation scan descriptor definitions.
 | 
			
		||||
 *	  POSTGRES internal relation scan descriptor definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: relscan.h,v 1.5 1996/11/04 08:52:41 scrappy Exp $
 | 
			
		||||
 * $Id: relscan.h,v 1.6 1997/09/07 04:56:08 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	RELSCAN_H
 | 
			
		||||
#ifndef RELSCAN_H
 | 
			
		||||
#define RELSCAN_H
 | 
			
		||||
 | 
			
		||||
#include <utils/tqual.h>
 | 
			
		||||
#include <storage/buf.h>
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
typedef ItemPointerData	MarkData;
 | 
			
		||||
typedef ItemPointerData MarkData;
 | 
			
		||||
 | 
			
		||||
typedef struct HeapScanDescData {
 | 
			
		||||
	Relation	rs_rd;		/* pointer to relation descriptor */
 | 
			
		||||
	HeapTuple	rs_ptup;	/* previous tuple in scan */
 | 
			
		||||
	HeapTuple	rs_ctup;	/* current tuple in scan */
 | 
			
		||||
	HeapTuple	rs_ntup;	/* next tuple in scan */
 | 
			
		||||
	Buffer		rs_pbuf;	/* previous buffer in scan */
 | 
			
		||||
	Buffer		rs_cbuf;	/* current buffer in scan */
 | 
			
		||||
	Buffer		rs_nbuf;	/* next buffer in scan */
 | 
			
		||||
	ItemPointerData	rs_mptid;	/* marked previous tid */
 | 
			
		||||
	ItemPointerData	rs_mctid;	/* marked current tid */
 | 
			
		||||
	ItemPointerData	rs_mntid;	/* marked next tid */
 | 
			
		||||
	ItemPointerData	rs_mcd;		/* marked current delta XXX ??? */
 | 
			
		||||
	bool		rs_atend;	/* restart scan at end? */
 | 
			
		||||
	TimeQual	rs_tr;		/* time qualification */
 | 
			
		||||
	uint16		rs_cdelta;	/* current delta in chain */
 | 
			
		||||
	uint16		rs_nkeys;	/* number of attributes in keys */
 | 
			
		||||
	ScanKey		rs_key;		/* key descriptors */
 | 
			
		||||
} HeapScanDescData;
 | 
			
		||||
typedef struct HeapScanDescData
 | 
			
		||||
{
 | 
			
		||||
	Relation		rs_rd;		/* pointer to relation descriptor */
 | 
			
		||||
	HeapTuple		rs_ptup;	/* previous tuple in scan */
 | 
			
		||||
	HeapTuple		rs_ctup;	/* current tuple in scan */
 | 
			
		||||
	HeapTuple		rs_ntup;	/* next tuple in scan */
 | 
			
		||||
	Buffer			rs_pbuf;	/* previous buffer in scan */
 | 
			
		||||
	Buffer			rs_cbuf;	/* current buffer in scan */
 | 
			
		||||
	Buffer			rs_nbuf;	/* next buffer in scan */
 | 
			
		||||
	ItemPointerData rs_mptid;	/* marked previous tid */
 | 
			
		||||
	ItemPointerData rs_mctid;	/* marked current tid */
 | 
			
		||||
	ItemPointerData rs_mntid;	/* marked next tid */
 | 
			
		||||
	ItemPointerData rs_mcd;		/* marked current delta XXX ??? */
 | 
			
		||||
	bool			rs_atend;	/* restart scan at end? */
 | 
			
		||||
	TimeQual		rs_tr;		/* time qualification */
 | 
			
		||||
	uint16			rs_cdelta;	/* current delta in chain */
 | 
			
		||||
	uint16			rs_nkeys;	/* number of attributes in keys */
 | 
			
		||||
	ScanKey			rs_key;		/* key descriptors */
 | 
			
		||||
}				HeapScanDescData;
 | 
			
		||||
 | 
			
		||||
typedef HeapScanDescData *HeapScanDesc;
 | 
			
		||||
 | 
			
		||||
typedef struct IndexScanDescData {
 | 
			
		||||
	Relation	relation;		/* relation descriptor */
 | 
			
		||||
	void		*opaque;		/* am-specific slot */
 | 
			
		||||
	ItemPointerData	previousItemData;	/* previous index pointer */
 | 
			
		||||
	ItemPointerData	currentItemData;	/* current index pointer */
 | 
			
		||||
	ItemPointerData	nextItemData;		/* next index pointer */
 | 
			
		||||
	MarkData	previousMarkData;	/* marked previous pointer */
 | 
			
		||||
	MarkData	currentMarkData;	/* marked current  pointer */
 | 
			
		||||
	MarkData	nextMarkData;		/* marked next pointer */
 | 
			
		||||
	uint8		flags;			/* scan position flags */
 | 
			
		||||
	bool		scanFromEnd;		/* restart scan at end? */
 | 
			
		||||
	uint16		numberOfKeys;		/* number of key attributes */
 | 
			
		||||
	ScanKey		keyData;		/* key descriptor */
 | 
			
		||||
} IndexScanDescData;
 | 
			
		||||
typedef struct IndexScanDescData
 | 
			
		||||
{
 | 
			
		||||
	Relation		relation;	/* relation descriptor */
 | 
			
		||||
	void		   *opaque;		/* am-specific slot */
 | 
			
		||||
	ItemPointerData previousItemData;	/* previous index pointer */
 | 
			
		||||
	ItemPointerData currentItemData;	/* current index pointer */
 | 
			
		||||
	ItemPointerData nextItemData;		/* next index pointer */
 | 
			
		||||
	MarkData		previousMarkData;	/* marked previous pointer */
 | 
			
		||||
	MarkData		currentMarkData;	/* marked current  pointer */
 | 
			
		||||
	MarkData		nextMarkData;		/* marked next pointer */
 | 
			
		||||
	uint8			flags;		/* scan position flags */
 | 
			
		||||
	bool			scanFromEnd;/* restart scan at end? */
 | 
			
		||||
	uint16			numberOfKeys;		/* number of key attributes */
 | 
			
		||||
	ScanKey			keyData;	/* key descriptor */
 | 
			
		||||
}				IndexScanDescData;
 | 
			
		||||
 | 
			
		||||
typedef IndexScanDescData	*IndexScanDesc;
 | 
			
		||||
typedef IndexScanDescData *IndexScanDesc;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	IndexScanDescPtr is used in the executor where we have to
 | 
			
		||||
 *	keep track of several index scans when using several indices
 | 
			
		||||
 *	- cim 9/10/89
 | 
			
		||||
 *		IndexScanDescPtr is used in the executor where we have to
 | 
			
		||||
 *		keep track of several index scans when using several indices
 | 
			
		||||
 *		- cim 9/10/89
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef IndexScanDesc		*IndexScanDescPtr;
 | 
			
		||||
typedef IndexScanDesc *IndexScanDescPtr;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * HeapScanIsValid --
 | 
			
		||||
 *	True iff the heap scan is valid.
 | 
			
		||||
 *		True iff the heap scan is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	HeapScanIsValid(scan) PointerIsValid(scan)
 | 
			
		||||
#define HeapScanIsValid(scan) PointerIsValid(scan)
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * IndexScanIsValid --
 | 
			
		||||
 *	True iff the index scan is valid.
 | 
			
		||||
 *		True iff the index scan is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define IndexScanIsValid(scan) PointerIsValid(scan)
 | 
			
		||||
 | 
			
		||||
#endif	/* RELSCAN_H */
 | 
			
		||||
#endif							/* RELSCAN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * rtree.h--
 | 
			
		||||
 *    common declarations for the rtree access method code.
 | 
			
		||||
 *	  common declarations for the rtree access method code.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: rtree.h,v 1.6 1997/08/19 21:37:36 momjian Exp $
 | 
			
		||||
 * $Id: rtree.h,v 1.7 1997/09/07 04:56:09 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -23,116 +23,125 @@
 | 
			
		||||
#include <storage/off.h>
 | 
			
		||||
 | 
			
		||||
/* see rtstrat.c for what all this is about */
 | 
			
		||||
#define RTNStrategies			8
 | 
			
		||||
#define RTLeftStrategyNumber		1
 | 
			
		||||
#define RTOverLeftStrategyNumber	2
 | 
			
		||||
#define RTOverlapStrategyNumber		3
 | 
			
		||||
#define RTOverRightStrategyNumber	4
 | 
			
		||||
#define RTRightStrategyNumber		5
 | 
			
		||||
#define RTSameStrategyNumber		6
 | 
			
		||||
#define RTContainsStrategyNumber	7
 | 
			
		||||
#define RTContainedByStrategyNumber	8
 | 
			
		||||
#define RTNStrategies					8
 | 
			
		||||
#define RTLeftStrategyNumber			1
 | 
			
		||||
#define RTOverLeftStrategyNumber		2
 | 
			
		||||
#define RTOverlapStrategyNumber			3
 | 
			
		||||
#define RTOverRightStrategyNumber		4
 | 
			
		||||
#define RTRightStrategyNumber			5
 | 
			
		||||
#define RTSameStrategyNumber			6
 | 
			
		||||
#define RTContainsStrategyNumber		7
 | 
			
		||||
#define RTContainedByStrategyNumber		8
 | 
			
		||||
 | 
			
		||||
#define RTNProcs			3
 | 
			
		||||
#define RT_UNION_PROC			1
 | 
			
		||||
#define RT_INTER_PROC			2
 | 
			
		||||
#define RT_SIZE_PROC			3
 | 
			
		||||
#define RTNProcs						3
 | 
			
		||||
#define RT_UNION_PROC					1
 | 
			
		||||
#define RT_INTER_PROC					2
 | 
			
		||||
#define RT_SIZE_PROC					3
 | 
			
		||||
 | 
			
		||||
#define F_LEAF		(1 << 0)
 | 
			
		||||
#define F_LEAF			(1 << 0)
 | 
			
		||||
 | 
			
		||||
typedef struct RTreePageOpaqueData {
 | 
			
		||||
	uint32		flags;
 | 
			
		||||
} RTreePageOpaqueData;
 | 
			
		||||
typedef struct RTreePageOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	uint32			flags;
 | 
			
		||||
}				RTreePageOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef RTreePageOpaqueData	*RTreePageOpaque;
 | 
			
		||||
typedef RTreePageOpaqueData *RTreePageOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When we descend a tree, we keep a stack of parent pointers.
 | 
			
		||||
 *	When we descend a tree, we keep a stack of parent pointers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct RTSTACK {
 | 
			
		||||
	struct RTSTACK	*rts_parent;
 | 
			
		||||
typedef struct RTSTACK
 | 
			
		||||
{
 | 
			
		||||
	struct RTSTACK *rts_parent;
 | 
			
		||||
	OffsetNumber	rts_child;
 | 
			
		||||
	BlockNumber	rts_blk;
 | 
			
		||||
} RTSTACK;
 | 
			
		||||
	BlockNumber		rts_blk;
 | 
			
		||||
}				RTSTACK;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When we're doing a scan, we need to keep track of the parent stack
 | 
			
		||||
 *  for the marked and current items.  Also, rtrees have the following
 | 
			
		||||
 *  property:  if you're looking for the box (1,1,2,2), on the internal
 | 
			
		||||
 *  nodes you have to search for all boxes that *contain* (1,1,2,2), and
 | 
			
		||||
 *  not the ones that match it.  We have a private scan key for internal
 | 
			
		||||
 *  nodes in the opaque structure for rtrees for this reason.  See
 | 
			
		||||
 *  access/index-rtree/rtscan.c and rtstrat.c for how it gets initialized.
 | 
			
		||||
 *	When we're doing a scan, we need to keep track of the parent stack
 | 
			
		||||
 *	for the marked and current items.  Also, rtrees have the following
 | 
			
		||||
 *	property:  if you're looking for the box (1,1,2,2), on the internal
 | 
			
		||||
 *	nodes you have to search for all boxes that *contain* (1,1,2,2), and
 | 
			
		||||
 *	not the ones that match it.  We have a private scan key for internal
 | 
			
		||||
 *	nodes in the opaque structure for rtrees for this reason.  See
 | 
			
		||||
 *	access/index-rtree/rtscan.c and rtstrat.c for how it gets initialized.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
typedef struct RTreeScanOpaqueData {
 | 
			
		||||
	struct RTSTACK	*s_stack;
 | 
			
		||||
	struct RTSTACK	*s_markstk;
 | 
			
		||||
	uint16		s_flags;
 | 
			
		||||
	uint16		s_internalNKey;
 | 
			
		||||
	ScanKey		s_internalKey;
 | 
			
		||||
} RTreeScanOpaqueData;
 | 
			
		||||
typedef struct RTreeScanOpaqueData
 | 
			
		||||
{
 | 
			
		||||
	struct RTSTACK *s_stack;
 | 
			
		||||
	struct RTSTACK *s_markstk;
 | 
			
		||||
	uint16			s_flags;
 | 
			
		||||
	uint16			s_internalNKey;
 | 
			
		||||
	ScanKey			s_internalKey;
 | 
			
		||||
}				RTreeScanOpaqueData;
 | 
			
		||||
 | 
			
		||||
typedef RTreeScanOpaqueData	*RTreeScanOpaque;
 | 
			
		||||
typedef RTreeScanOpaqueData *RTreeScanOpaque;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When we're doing a scan and updating a tree at the same time, the
 | 
			
		||||
 *  updates may affect the scan.  We use the flags entry of the scan's
 | 
			
		||||
 *  opaque space to record our actual position in response to updates
 | 
			
		||||
 *  that we can't handle simply by adjusting pointers.
 | 
			
		||||
 *	When we're doing a scan and updating a tree at the same time, the
 | 
			
		||||
 *	updates may affect the scan.  We use the flags entry of the scan's
 | 
			
		||||
 *	opaque space to record our actual position in response to updates
 | 
			
		||||
 *	that we can't handle simply by adjusting pointers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define RTS_CURBEFORE	((uint16) (1 << 0))
 | 
			
		||||
#define RTS_MRKBEFORE	((uint16) (1 << 1))
 | 
			
		||||
 | 
			
		||||
/* root page of an rtree */
 | 
			
		||||
#define P_ROOT		0
 | 
			
		||||
#define P_ROOT			0
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  When we update a relation on which we're doing a scan, we need to
 | 
			
		||||
 *  check the scan and fix it if the update affected any of the pages it
 | 
			
		||||
 *  touches.  Otherwise, we can miss records that we should see.  The only
 | 
			
		||||
 *  times we need to do this are for deletions and splits.  See the code in
 | 
			
		||||
 *  rtscan.c for how the scan is fixed.  These two contants tell us what sort
 | 
			
		||||
 *  of operation changed the index.
 | 
			
		||||
 *	When we update a relation on which we're doing a scan, we need to
 | 
			
		||||
 *	check the scan and fix it if the update affected any of the pages it
 | 
			
		||||
 *	touches.  Otherwise, we can miss records that we should see.  The only
 | 
			
		||||
 *	times we need to do this are for deletions and splits.	See the code in
 | 
			
		||||
 *	rtscan.c for how the scan is fixed.  These two contants tell us what sort
 | 
			
		||||
 *	of operation changed the index.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define	RTOP_DEL	0
 | 
			
		||||
#define	RTOP_SPLIT	1
 | 
			
		||||
#define RTOP_DEL		0
 | 
			
		||||
#define RTOP_SPLIT		1
 | 
			
		||||
 | 
			
		||||
/* defined in rtree.c */
 | 
			
		||||
extern void freestack(RTSTACK *s);
 | 
			
		||||
extern void		freestack(RTSTACK * s);
 | 
			
		||||
 | 
			
		||||
/* rget.c */
 | 
			
		||||
extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *	RTree code.
 | 
			
		||||
 *	Defined in access/index-rtree/
 | 
			
		||||
 *		RTree code.
 | 
			
		||||
 *		Defined in access/index-rtree/
 | 
			
		||||
 */
 | 
			
		||||
extern InsertIndexResult rtinsert(Relation r, Datum *datum, char *nulls,
 | 
			
		||||
			ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char *rtdelete(Relation r, ItemPointer tid);
 | 
			
		||||
extern InsertIndexResult
 | 
			
		||||
rtinsert(Relation r, Datum * datum, char *nulls,
 | 
			
		||||
		 ItemPointer ht_ctid, Relation heapRel);
 | 
			
		||||
extern char    *rtdelete(Relation r, ItemPointer tid);
 | 
			
		||||
 | 
			
		||||
extern RetrieveIndexResult rtgettuple(IndexScanDesc s, ScanDirection dir);
 | 
			
		||||
extern IndexScanDesc rtbeginscan(Relation r, bool fromEnd, uint16 nkeys,
 | 
			
		||||
	    ScanKey key);
 | 
			
		||||
extern IndexScanDesc
 | 
			
		||||
rtbeginscan(Relation r, bool fromEnd, uint16 nkeys,
 | 
			
		||||
			ScanKey key);
 | 
			
		||||
 | 
			
		||||
extern void rtendscan(IndexScanDesc s);
 | 
			
		||||
extern void rtmarkpos(IndexScanDesc s);
 | 
			
		||||
extern void rtrestrpos(IndexScanDesc s);
 | 
			
		||||
extern void rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key);
 | 
			
		||||
extern void rtbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
	AttrNumber *attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
	Datum *params, FuncIndexInfo *finfo, PredInfo *predInfo);
 | 
			
		||||
extern void _rtdump(Relation r);
 | 
			
		||||
extern void		rtendscan(IndexScanDesc s);
 | 
			
		||||
extern void		rtmarkpos(IndexScanDesc s);
 | 
			
		||||
extern void		rtrestrpos(IndexScanDesc s);
 | 
			
		||||
extern void		rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key);
 | 
			
		||||
extern void
 | 
			
		||||
rtbuild(Relation heap, Relation index, int natts,
 | 
			
		||||
		AttrNumber * attnum, IndexStrategy istrat, uint16 pcount,
 | 
			
		||||
		Datum * params, FuncIndexInfo * finfo, PredInfo * predInfo);
 | 
			
		||||
extern void		_rtdump(Relation r);
 | 
			
		||||
 | 
			
		||||
/* rtscan.c */
 | 
			
		||||
extern void rtadjscans(Relation r, int op, BlockNumber blkno,
 | 
			
		||||
				OffsetNumber offnum);
 | 
			
		||||
/* rtstrat.h */
 | 
			
		||||
extern RegProcedure RTMapOperator(Relation r, AttrNumber attnum,
 | 
			
		||||
			RegProcedure proc);
 | 
			
		||||
extern void
 | 
			
		||||
rtadjscans(Relation r, int op, BlockNumber blkno,
 | 
			
		||||
		   OffsetNumber offnum);
 | 
			
		||||
 | 
			
		||||
#endif /* RTREE_H */
 | 
			
		||||
/* rtstrat.h */
 | 
			
		||||
extern RegProcedure
 | 
			
		||||
RTMapOperator(Relation r, AttrNumber attnum,
 | 
			
		||||
			  RegProcedure proc);
 | 
			
		||||
 | 
			
		||||
#endif							/* RTREE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * rtscan.h--
 | 
			
		||||
 *    routines defined in access/rtree/rtscan.c
 | 
			
		||||
 *	  routines defined in access/rtree/rtscan.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: rtscan.h,v 1.1 1996/08/27 21:50:22 scrappy Exp $
 | 
			
		||||
 * $Id: rtscan.h,v 1.2 1997/09/07 04:56:10 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef RTSCAN_H
 | 
			
		||||
 | 
			
		||||
void rtadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum);
 | 
			
		||||
void			rtadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum);
 | 
			
		||||
 | 
			
		||||
#endif /* RTSCAN_H */
 | 
			
		||||
#endif							/* RTSCAN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,18 +1,19 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * rtstrat.h--
 | 
			
		||||
 *    routines defined in access/rtree/rtstrat.c
 | 
			
		||||
 *	  routines defined in access/rtree/rtstrat.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: rtstrat.h,v 1.1 1996/08/27 21:50:23 scrappy Exp $
 | 
			
		||||
 * $Id: rtstrat.h,v 1.2 1997/09/07 04:56:11 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef RTSTRAT_H
 | 
			
		||||
 | 
			
		||||
extern RegProcedure RTMapOperator(Relation r,  AttrNumber attnum,
 | 
			
		||||
				  RegProcedure proc);
 | 
			
		||||
extern RegProcedure
 | 
			
		||||
RTMapOperator(Relation r, AttrNumber attnum,
 | 
			
		||||
			  RegProcedure proc);
 | 
			
		||||
 | 
			
		||||
#endif /* RTSTRAT_H */
 | 
			
		||||
#endif							/* RTSTRAT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * sdir.h--
 | 
			
		||||
 *    POSTGRES scan direction definitions.
 | 
			
		||||
 *	  POSTGRES scan direction definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: sdir.h,v 1.2 1996/10/31 09:46:42 scrappy Exp $
 | 
			
		||||
 * $Id: sdir.h,v 1.3 1997/09/07 04:56:12 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	SDIR_H
 | 
			
		||||
#ifndef SDIR_H
 | 
			
		||||
#define SDIR_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -18,39 +18,40 @@
 | 
			
		||||
 * ScanDirection was an int8 for no apparent reason. I kept the original
 | 
			
		||||
 * values because I'm not sure if I'll break anything otherwise.  -ay 2/95
 | 
			
		||||
 */
 | 
			
		||||
typedef enum ScanDirection {
 | 
			
		||||
    BackwardScanDirection = -1,
 | 
			
		||||
    NoMovementScanDirection = 0,
 | 
			
		||||
    ForwardScanDirection = 1
 | 
			
		||||
typedef enum ScanDirection
 | 
			
		||||
{
 | 
			
		||||
	BackwardScanDirection = -1,
 | 
			
		||||
	NoMovementScanDirection = 0,
 | 
			
		||||
	ForwardScanDirection = 1
 | 
			
		||||
} ScanDirection;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ScanDirectionIsValid --
 | 
			
		||||
 *	True iff scan direction is valid.
 | 
			
		||||
 *		True iff scan direction is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define ScanDirectionIsValid(direction) \
 | 
			
		||||
    ((bool) (BackwardScanDirection <= direction && \
 | 
			
		||||
	     direction <= ForwardScanDirection))
 | 
			
		||||
	((bool) (BackwardScanDirection <= direction && \
 | 
			
		||||
			 direction <= ForwardScanDirection))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ScanDirectionIsBackward --
 | 
			
		||||
 *	True iff scan direction is backward.
 | 
			
		||||
 *		True iff scan direction is backward.
 | 
			
		||||
 */
 | 
			
		||||
#define ScanDirectionIsBackward(direction) \
 | 
			
		||||
    ((bool) (direction == BackwardScanDirection))
 | 
			
		||||
	((bool) (direction == BackwardScanDirection))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ScanDirectionIsNoMovement --
 | 
			
		||||
 *	True iff scan direction indicates no movement.
 | 
			
		||||
 *		True iff scan direction indicates no movement.
 | 
			
		||||
 */
 | 
			
		||||
#define ScanDirectionIsNoMovement(direction) \
 | 
			
		||||
    ((bool) (direction == NoMovementScanDirection))
 | 
			
		||||
	((bool) (direction == NoMovementScanDirection))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * ScanDirectionIsForward --
 | 
			
		||||
 *	True iff scan direction is forward.
 | 
			
		||||
 *		True iff scan direction is forward.
 | 
			
		||||
 */
 | 
			
		||||
#define ScanDirectionIsForward(direction) \
 | 
			
		||||
    ((bool) (direction == ForwardScanDirection))
 | 
			
		||||
	((bool) (direction == ForwardScanDirection))
 | 
			
		||||
 | 
			
		||||
#endif	/* SDIR_H */
 | 
			
		||||
#endif							/* SDIR_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,50 +1,52 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * skey.h--
 | 
			
		||||
 *    POSTGRES scan key definitions.
 | 
			
		||||
 *	  POSTGRES scan key definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: skey.h,v 1.3 1996/11/04 07:45:26 scrappy Exp $
 | 
			
		||||
 * $Id: skey.h,v 1.4 1997/09/07 04:56:13 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Note:
 | 
			
		||||
 *	Needs more accessor/assignment routines.
 | 
			
		||||
 *		Needs more accessor/assignment routines.
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	SKEY_H
 | 
			
		||||
#ifndef SKEY_H
 | 
			
		||||
#define SKEY_H
 | 
			
		||||
 | 
			
		||||
#include <access/attnum.h>
 | 
			
		||||
 | 
			
		||||
typedef struct ScanKeyData {
 | 
			
		||||
    bits16		sk_flags;	/* flags */
 | 
			
		||||
    AttrNumber		sk_attno;	/* domain number */
 | 
			
		||||
    RegProcedure	sk_procedure;	/* procedure OID */
 | 
			
		||||
    func_ptr            sk_func;
 | 
			
		||||
    int32 		sk_nargs;
 | 
			
		||||
    Datum		sk_argument;	/* data to compare */
 | 
			
		||||
} ScanKeyData;
 | 
			
		||||
typedef struct ScanKeyData
 | 
			
		||||
{
 | 
			
		||||
	bits16			sk_flags;	/* flags */
 | 
			
		||||
	AttrNumber		sk_attno;	/* domain number */
 | 
			
		||||
	RegProcedure	sk_procedure;		/* procedure OID */
 | 
			
		||||
	func_ptr		sk_func;
 | 
			
		||||
	int32			sk_nargs;
 | 
			
		||||
	Datum			sk_argument;/* data to compare */
 | 
			
		||||
}				ScanKeyData;
 | 
			
		||||
 | 
			
		||||
typedef ScanKeyData	*ScanKey;
 | 
			
		||||
typedef ScanKeyData *ScanKey;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define	SK_ISNULL	0x1
 | 
			
		||||
#define	SK_UNARY	0x2
 | 
			
		||||
#define	SK_NEGATE	0x4
 | 
			
		||||
#define	SK_COMMUTE	0x8
 | 
			
		||||
#define SK_ISNULL		0x1
 | 
			
		||||
#define SK_UNARY		0x2
 | 
			
		||||
#define SK_NEGATE		0x4
 | 
			
		||||
#define SK_COMMUTE		0x8
 | 
			
		||||
 | 
			
		||||
#define ScanUnmarked		0x01
 | 
			
		||||
#define ScanUnmarked			0x01
 | 
			
		||||
#define ScanUncheckedPrevious	0x02
 | 
			
		||||
#define ScanUncheckedNext	0x04
 | 
			
		||||
#define ScanUncheckedNext		0x04
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in access/common/scankey.c
 | 
			
		||||
 */
 | 
			
		||||
extern void ScanKeyEntrySetIllegal(ScanKey entry);
 | 
			
		||||
extern void ScanKeyEntryInitialize(ScanKey entry, bits16 flags,
 | 
			
		||||
     AttrNumber attributeNumber, RegProcedure procedure, Datum argument);
 | 
			
		||||
extern void		ScanKeyEntrySetIllegal(ScanKey entry);
 | 
			
		||||
extern void
 | 
			
		||||
ScanKeyEntryInitialize(ScanKey entry, bits16 flags,
 | 
			
		||||
	 AttrNumber attributeNumber, RegProcedure procedure, Datum argument);
 | 
			
		||||
 | 
			
		||||
#endif	/* SKEY_H */
 | 
			
		||||
#endif							/* SKEY_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * strat.h--
 | 
			
		||||
 *    index strategy type definitions
 | 
			
		||||
 *    (separated out from original istrat.h to avoid circular refs)
 | 
			
		||||
 *	  index strategy type definitions
 | 
			
		||||
 *	  (separated out from original istrat.h to avoid circular refs)
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: strat.h,v 1.4 1996/11/04 07:45:27 scrappy Exp $
 | 
			
		||||
 * $Id: strat.h,v 1.5 1997/09/07 04:56:14 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -18,67 +18,76 @@
 | 
			
		||||
 | 
			
		||||
typedef uint16	StrategyNumber;
 | 
			
		||||
 | 
			
		||||
#define InvalidStrategy	0
 | 
			
		||||
#define InvalidStrategy 0
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyTransformMapData {
 | 
			
		||||
    StrategyNumber	strategy[1];	/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
} StrategyTransformMapData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
typedef struct StrategyTransformMapData
 | 
			
		||||
{
 | 
			
		||||
	StrategyNumber	strategy[1];/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
}				StrategyTransformMapData;		/* VARIABLE LENGTH
 | 
			
		||||
 | 
			
		||||
typedef StrategyTransformMapData	*StrategyTransformMap;
 | 
			
		||||
												 * STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyOperatorData {
 | 
			
		||||
    StrategyNumber	strategy;
 | 
			
		||||
    bits16		flags;		/* scan qualification flags h/skey.h */
 | 
			
		||||
} StrategyOperatorData;
 | 
			
		||||
typedef StrategyTransformMapData *StrategyTransformMap;
 | 
			
		||||
 | 
			
		||||
typedef StrategyOperatorData	*StrategyOperator;
 | 
			
		||||
typedef struct StrategyOperatorData
 | 
			
		||||
{
 | 
			
		||||
	StrategyNumber	strategy;
 | 
			
		||||
	bits16			flags;		/* scan qualification flags h/skey.h */
 | 
			
		||||
}				StrategyOperatorData;
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyTermData {	/* conjunctive term */
 | 
			
		||||
    uint16			degree;
 | 
			
		||||
    StrategyOperatorData	operatorData[1];	/* VARIABLE LENGTH */
 | 
			
		||||
} StrategyTermData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
typedef StrategyOperatorData *StrategyOperator;
 | 
			
		||||
 | 
			
		||||
typedef StrategyTermData	*StrategyTerm;
 | 
			
		||||
typedef struct StrategyTermData
 | 
			
		||||
{								/* conjunctive term */
 | 
			
		||||
	uint16			degree;
 | 
			
		||||
	StrategyOperatorData operatorData[1];		/* VARIABLE LENGTH */
 | 
			
		||||
}				StrategyTermData;		/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyExpressionData {	/* disjunctive normal form */
 | 
			
		||||
    StrategyTerm	term[1];	/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
} StrategyExpressionData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
typedef StrategyTermData *StrategyTerm;
 | 
			
		||||
 | 
			
		||||
typedef StrategyExpressionData	*StrategyExpression;
 | 
			
		||||
typedef struct StrategyExpressionData
 | 
			
		||||
{								/* disjunctive normal form */
 | 
			
		||||
	StrategyTerm	term[1];	/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
}				StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyEvaluationData {
 | 
			
		||||
    StrategyNumber		maxStrategy;
 | 
			
		||||
    StrategyTransformMap	negateTransform;
 | 
			
		||||
    StrategyTransformMap	commuteTransform;
 | 
			
		||||
    StrategyTransformMap	negateCommuteTransform;
 | 
			
		||||
    StrategyExpression	expression[12];	/* XXX VARIABLE LENGTH */
 | 
			
		||||
} StrategyEvaluationData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
typedef StrategyExpressionData *StrategyExpression;
 | 
			
		||||
 | 
			
		||||
typedef StrategyEvaluationData	*StrategyEvaluation;
 | 
			
		||||
typedef struct StrategyEvaluationData
 | 
			
		||||
{
 | 
			
		||||
	StrategyNumber	maxStrategy;
 | 
			
		||||
	StrategyTransformMap negateTransform;
 | 
			
		||||
	StrategyTransformMap commuteTransform;
 | 
			
		||||
	StrategyTransformMap negateCommuteTransform;
 | 
			
		||||
	StrategyExpression expression[12];	/* XXX VARIABLE LENGTH */
 | 
			
		||||
}				StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef StrategyEvaluationData *StrategyEvaluation;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * StrategyTransformMapIsValid --
 | 
			
		||||
 *	Returns true iff strategy transformation map is valid.
 | 
			
		||||
 *		Returns true iff strategy transformation map is valid.
 | 
			
		||||
 */
 | 
			
		||||
#define	StrategyTransformMapIsValid(transform) PointerIsValid(transform)
 | 
			
		||||
#define StrategyTransformMapIsValid(transform) PointerIsValid(transform)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef	CorrectStrategies		/* XXX this should be removable */
 | 
			
		||||
#define AMStrategies(foo)	12
 | 
			
		||||
#else	/* !defined(CorrectStrategies) */
 | 
			
		||||
#define AMStrategies(foo)	(foo)
 | 
			
		||||
#endif	/* !defined(CorrectStrategies) */
 | 
			
		||||
#ifndef CorrectStrategies		/* XXX this should be removable */
 | 
			
		||||
#define AMStrategies(foo)		12
 | 
			
		||||
#else							/* !defined(CorrectStrategies) */
 | 
			
		||||
#define AMStrategies(foo)		(foo)
 | 
			
		||||
#endif							/* !defined(CorrectStrategies) */
 | 
			
		||||
 | 
			
		||||
typedef struct StrategyMapData {
 | 
			
		||||
typedef struct StrategyMapData
 | 
			
		||||
{
 | 
			
		||||
	ScanKeyData		entry[1];	/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
} StrategyMapData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
}				StrategyMapData;/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef StrategyMapData	*StrategyMap;
 | 
			
		||||
typedef StrategyMapData *StrategyMap;
 | 
			
		||||
 | 
			
		||||
typedef struct IndexStrategyData {
 | 
			
		||||
	StrategyMapData	strategyMapData[1];	/* VARIABLE LENGTH ARRAY */
 | 
			
		||||
} IndexStrategyData;	/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
typedef struct IndexStrategyData
 | 
			
		||||
{
 | 
			
		||||
	StrategyMapData strategyMapData[1]; /* VARIABLE LENGTH ARRAY */
 | 
			
		||||
}				IndexStrategyData;		/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef IndexStrategyData	*IndexStrategy;
 | 
			
		||||
typedef IndexStrategyData *IndexStrategy;
 | 
			
		||||
 | 
			
		||||
#endif /*STRAT_H */
 | 
			
		||||
#endif							/* STRAT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * transam.h--
 | 
			
		||||
 *    postgres transaction access method support code header
 | 
			
		||||
 *	  postgres transaction access method support code header
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: transam.h,v 1.7 1997/08/19 21:37:38 momjian Exp $
 | 
			
		||||
 * $Id: transam.h,v 1.8 1997/09/07 04:56:14 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *   NOTES
 | 
			
		||||
 *	Transaction System Version 101 now support proper oid
 | 
			
		||||
 *	generation and recording in the variable relation.
 | 
			
		||||
 *	 NOTES
 | 
			
		||||
 *		Transaction System Version 101 now support proper oid
 | 
			
		||||
 *		generation and recording in the variable relation.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,119 +21,122 @@
 | 
			
		||||
#include <utils/nabstime.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	transaction system version id
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		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
 | 
			
		||||
 *		transaction id status values
 | 
			
		||||
 *
 | 
			
		||||
 *	someday we will use "11" = 3 = XID_INVALID to mean the
 | 
			
		||||
 *	starting of run-length encoded log data.
 | 
			
		||||
 *		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 */
 | 
			
		||||
#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) */
 | 
			
		||||
typedef unsigned char XidStatus;/* (2 bits) */
 | 
			
		||||
 | 
			
		||||
/* ----------
 | 
			
		||||
 *      note: we reserve the first 16384 object ids for internal use.
 | 
			
		||||
 *      oid's less than this appear in the .bki files.  the choice of
 | 
			
		||||
 *      16384 is completely arbitrary.
 | 
			
		||||
 *		note: we reserve the first 16384 object ids for internal use.
 | 
			
		||||
 *		oid's less than this appear in the .bki files.  the choice of
 | 
			
		||||
 *		16384 is completely arbitrary.
 | 
			
		||||
 * ----------
 | 
			
		||||
 */
 | 
			
		||||
#define BootstrapObjectIdData 16384
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *   	BitIndexOf computes the index of the Nth xid on a given block
 | 
			
		||||
 *		BitIndexOf computes the index of the Nth xid on a given block
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define BitIndexOf(N)   ((N) * 2)
 | 
			
		||||
#define BitIndexOf(N)	((N) * 2)
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	transaction page definitions
 | 
			
		||||
 *		transaction page definitions
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define TP_DataSize		BLCKSZ
 | 
			
		||||
#define TP_NumXidStatusPerBlock	(TP_DataSize * 4)
 | 
			
		||||
#define TP_NumTimePerBlock	(TP_DataSize / 4)
 | 
			
		||||
#define TP_DataSize				BLCKSZ
 | 
			
		||||
#define TP_NumXidStatusPerBlock (TP_DataSize * 4)
 | 
			
		||||
#define TP_NumTimePerBlock		(TP_DataSize / 4)
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	LogRelationContents structure
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		The first 4 bytes of this relation store the version
 | 
			
		||||
 *		number of the transction system.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct LogRelationContentsData {
 | 
			
		||||
    int			TransSystemVersion;
 | 
			
		||||
} LogRelationContentsData;
 | 
			
		||||
typedef struct LogRelationContentsData
 | 
			
		||||
{
 | 
			
		||||
	int				TransSystemVersion;
 | 
			
		||||
}				LogRelationContentsData;
 | 
			
		||||
 | 
			
		||||
typedef LogRelationContentsData *LogRelationContents;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	TimeRelationContents structure
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		The first 4 bytes of this relation store the version
 | 
			
		||||
 *		number of the transction system.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct TimeRelationContentsData {
 | 
			
		||||
    int			TransSystemVersion;
 | 
			
		||||
} TimeRelationContentsData;
 | 
			
		||||
typedef struct TimeRelationContentsData
 | 
			
		||||
{
 | 
			
		||||
	int				TransSystemVersion;
 | 
			
		||||
}				TimeRelationContentsData;
 | 
			
		||||
 | 
			
		||||
typedef TimeRelationContentsData *TimeRelationContents;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	VariableRelationContents structure
 | 
			
		||||
 *		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 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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 *		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 struct VariableRelationContentsData
 | 
			
		||||
{
 | 
			
		||||
	int				TransSystemVersion;
 | 
			
		||||
	TransactionId	nextXidData;
 | 
			
		||||
	TransactionId	lastXidData;
 | 
			
		||||
	Oid				nextOid;
 | 
			
		||||
}				VariableRelationContentsData;
 | 
			
		||||
 | 
			
		||||
typedef VariableRelationContentsData *VariableRelationContents;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	extern declarations
 | 
			
		||||
 *		extern declarations
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -141,59 +144,64 @@ typedef VariableRelationContentsData *VariableRelationContents;
 | 
			
		||||
 * prototypes for functions in transam/transam.c
 | 
			
		||||
 */
 | 
			
		||||
extern AbsoluteTime TransactionIdGetCommitTime(TransactionId transactionId);
 | 
			
		||||
extern void InitializeTransactionLog(void);
 | 
			
		||||
extern bool TransactionIdDidCommit(TransactionId transactionId);
 | 
			
		||||
extern bool TransactionIdDidAbort(TransactionId transactionId);
 | 
			
		||||
extern void TransactionIdCommit(TransactionId transactionId);
 | 
			
		||||
extern void TransactionIdAbort(TransactionId transactionId);
 | 
			
		||||
extern void		InitializeTransactionLog(void);
 | 
			
		||||
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);
 | 
			
		||||
extern AbsoluteTime TransBlockNumberGetCommitTime(Relation relation,
 | 
			
		||||
	BlockNumber blockNumber, TransactionId xid, bool *failP);
 | 
			
		||||
extern void TransBlockNumberSetCommitTime(Relation relation,
 | 
			
		||||
	BlockNumber blockNumber, TransactionId xid, AbsoluteTime xtime,
 | 
			
		||||
	bool *failP);
 | 
			
		||||
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);
 | 
			
		||||
extern AbsoluteTime
 | 
			
		||||
TransBlockNumberGetCommitTime(Relation relation,
 | 
			
		||||
			   BlockNumber blockNumber, TransactionId xid, bool * failP);
 | 
			
		||||
extern void
 | 
			
		||||
TransBlockNumberSetCommitTime(Relation relation,
 | 
			
		||||
		  BlockNumber blockNumber, TransactionId xid, AbsoluteTime xtime,
 | 
			
		||||
							  bool * failP);
 | 
			
		||||
 | 
			
		||||
/* in transam/varsup.c */
 | 
			
		||||
extern void VariableRelationPutNextXid(TransactionId xid);
 | 
			
		||||
extern void GetNewTransactionId(TransactionId *xid);
 | 
			
		||||
extern void UpdateLastCommittedXid(TransactionId xid);
 | 
			
		||||
extern void GetNewObjectId(Oid *oid_return);
 | 
			
		||||
extern void CheckMaxObjectId(Oid assigned_oid);
 | 
			
		||||
extern void		VariableRelationPutNextXid(TransactionId xid);
 | 
			
		||||
extern void		GetNewTransactionId(TransactionId * xid);
 | 
			
		||||
extern void		UpdateLastCommittedXid(TransactionId xid);
 | 
			
		||||
extern void		GetNewObjectId(Oid * oid_return);
 | 
			
		||||
extern void		CheckMaxObjectId(Oid assigned_oid);
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	global variable extern declarations
 | 
			
		||||
 *		global variable extern declarations
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* in transam.c */
 | 
			
		||||
extern Relation	LogRelation;
 | 
			
		||||
extern Relation	TimeRelation;
 | 
			
		||||
extern Relation	VariableRelation;
 | 
			
		||||
extern Relation LogRelation;
 | 
			
		||||
extern Relation TimeRelation;
 | 
			
		||||
extern Relation VariableRelation;
 | 
			
		||||
 | 
			
		||||
extern TransactionId	cachedGetCommitTimeXid;
 | 
			
		||||
extern AbsoluteTime	cachedGetCommitTime;
 | 
			
		||||
extern TransactionId	cachedTestXid;
 | 
			
		||||
extern XidStatus	cachedTestXidStatus;
 | 
			
		||||
extern TransactionId cachedGetCommitTimeXid;
 | 
			
		||||
extern AbsoluteTime cachedGetCommitTime;
 | 
			
		||||
extern TransactionId cachedTestXid;
 | 
			
		||||
extern XidStatus cachedTestXidStatus;
 | 
			
		||||
 | 
			
		||||
extern TransactionId NullTransactionId;
 | 
			
		||||
extern TransactionId AmiTransactionId;
 | 
			
		||||
extern TransactionId FirstTransactionId;
 | 
			
		||||
 | 
			
		||||
extern int RecoveryCheckingEnableState;
 | 
			
		||||
extern int		RecoveryCheckingEnableState;
 | 
			
		||||
 | 
			
		||||
/* in transsup.c */
 | 
			
		||||
extern bool AMI_OVERRIDE;	
 | 
			
		||||
extern bool		AMI_OVERRIDE;
 | 
			
		||||
 | 
			
		||||
/* in varsup.c */
 | 
			
		||||
extern int OidGenLockId;
 | 
			
		||||
extern int		OidGenLockId;
 | 
			
		||||
 | 
			
		||||
#endif /* TRAMSAM_H */
 | 
			
		||||
#endif							/* TRAMSAM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * tupdesc.h--
 | 
			
		||||
 *    POSTGRES tuple descriptor definitions.
 | 
			
		||||
 *	  POSTGRES tuple descriptor definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: tupdesc.h,v 1.8 1997/08/22 03:55:39 vadim Exp $
 | 
			
		||||
 * $Id: tupdesc.h,v 1.9 1997/09/07 04:56:16 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	TUPDESC_H
 | 
			
		||||
#ifndef TUPDESC_H
 | 
			
		||||
#define TUPDESC_H
 | 
			
		||||
 | 
			
		||||
#include <nodes/pg_list.h>
 | 
			
		||||
@@ -18,56 +18,61 @@
 | 
			
		||||
#include <catalog/pg_attribute.h>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
typedef struct attrDefault {
 | 
			
		||||
    AttrNumber		adnum;
 | 
			
		||||
    char		*adbin;
 | 
			
		||||
    char		*adsrc;
 | 
			
		||||
} AttrDefault;
 | 
			
		||||
typedef struct attrDefault
 | 
			
		||||
{
 | 
			
		||||
	AttrNumber		adnum;
 | 
			
		||||
	char		   *adbin;
 | 
			
		||||
	char		   *adsrc;
 | 
			
		||||
}				AttrDefault;
 | 
			
		||||
 | 
			
		||||
typedef struct constrCheck {
 | 
			
		||||
    char		*ccname;
 | 
			
		||||
    char		*ccbin;
 | 
			
		||||
    char		*ccsrc;
 | 
			
		||||
} ConstrCheck;
 | 
			
		||||
typedef struct constrCheck
 | 
			
		||||
{
 | 
			
		||||
	char		   *ccname;
 | 
			
		||||
	char		   *ccbin;
 | 
			
		||||
	char		   *ccsrc;
 | 
			
		||||
}				ConstrCheck;
 | 
			
		||||
 | 
			
		||||
/* This structure contains constraints of a tuple */
 | 
			
		||||
typedef struct tupleConstr {
 | 
			
		||||
    AttrDefault		*defval;
 | 
			
		||||
    ConstrCheck		*check;
 | 
			
		||||
    uint16		num_defval;
 | 
			
		||||
    uint16		num_check;
 | 
			
		||||
    bool		has_not_null;
 | 
			
		||||
} TupleConstr;
 | 
			
		||||
typedef struct tupleConstr
 | 
			
		||||
{
 | 
			
		||||
	AttrDefault    *defval;
 | 
			
		||||
	ConstrCheck    *check;
 | 
			
		||||
	uint16			num_defval;
 | 
			
		||||
	uint16			num_check;
 | 
			
		||||
	bool			has_not_null;
 | 
			
		||||
}				TupleConstr;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * This structure contains all information (i.e. from Classes
 | 
			
		||||
 * pg_attribute, pg_attrdef, pg_relcheck) for a tuple. 
 | 
			
		||||
 * pg_attribute, pg_attrdef, pg_relcheck) for a tuple.
 | 
			
		||||
 */
 | 
			
		||||
typedef struct tupleDesc {
 | 
			
		||||
    int  natts;      
 | 
			
		||||
      /* Number of attributes in the tuple */
 | 
			
		||||
    AttributeTupleForm *attrs;
 | 
			
		||||
      /* attrs[N] is a pointer to the description of Attribute Number N+1.  */
 | 
			
		||||
    TupleConstr *constr;
 | 
			
		||||
} *TupleDesc;
 | 
			
		||||
typedef struct tupleDesc
 | 
			
		||||
{
 | 
			
		||||
	int				natts;
 | 
			
		||||
	/* Number of attributes in the tuple */
 | 
			
		||||
	AttributeTupleForm *attrs;
 | 
			
		||||
	/* attrs[N] is a pointer to the description of Attribute Number N+1.  */
 | 
			
		||||
	TupleConstr    *constr;
 | 
			
		||||
}			   *TupleDesc;
 | 
			
		||||
 | 
			
		||||
extern TupleDesc CreateTemplateTupleDesc(int natts);
 | 
			
		||||
 | 
			
		||||
extern TupleDesc CreateTupleDesc(int natts, AttributeTupleForm *attrs);
 | 
			
		||||
extern TupleDesc CreateTupleDesc(int natts, AttributeTupleForm * attrs);
 | 
			
		||||
 | 
			
		||||
extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc);
 | 
			
		||||
 | 
			
		||||
extern TupleDesc CreateTupleDescCopyConstr(TupleDesc tupdesc);
 | 
			
		||||
 | 
			
		||||
extern void FreeTupleDesc(TupleDesc tupdesc);
 | 
			
		||||
extern void		FreeTupleDesc(TupleDesc tupdesc);
 | 
			
		||||
 | 
			
		||||
extern bool TupleDescInitEntry(TupleDesc desc,
 | 
			
		||||
			       AttrNumber attributeNumber,
 | 
			
		||||
			       char *attributeName, 
 | 
			
		||||
			       char *typeName, 
 | 
			
		||||
			       int attdim, 
 | 
			
		||||
			       bool attisset);
 | 
			
		||||
extern bool
 | 
			
		||||
TupleDescInitEntry(TupleDesc desc,
 | 
			
		||||
				   AttrNumber attributeNumber,
 | 
			
		||||
				   char *attributeName,
 | 
			
		||||
				   char *typeName,
 | 
			
		||||
				   int attdim,
 | 
			
		||||
				   bool attisset);
 | 
			
		||||
 | 
			
		||||
extern TupleDesc BuildDescForRelation(List *schema, char *relname);
 | 
			
		||||
extern TupleDesc BuildDescForRelation(List * schema, char *relname);
 | 
			
		||||
 | 
			
		||||
#endif	/* TUPDESC_H */
 | 
			
		||||
#endif							/* TUPDESC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * tupmacs.h--
 | 
			
		||||
 *    Tuple macros used by both index tuples and heap tuples.
 | 
			
		||||
 *	  Tuple macros used by both index tuples and heap tuples.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: tupmacs.h,v 1.1 1996/08/27 21:50:27 scrappy Exp $
 | 
			
		||||
 * $Id: tupmacs.h,v 1.2 1997/09/07 04:56:17 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -22,7 +22,7 @@
 | 
			
		||||
 * given a AttributeTupleForm and a pointer into a tuple's data
 | 
			
		||||
 * area, return the correct value or pointer.
 | 
			
		||||
 *
 | 
			
		||||
 * We return a 4 byte (char *) value in all cases.  If the attribute has
 | 
			
		||||
 * We return a 4 byte (char *) value in all cases.	If the attribute has
 | 
			
		||||
 * "byval" false or has variable length, we return the same pointer
 | 
			
		||||
 * into the tuple data area that we're passed.  Otherwise, we return
 | 
			
		||||
 * the 1, 2, or 4 bytes pointed to by it, properly extended to 4
 | 
			
		||||
@@ -31,7 +31,7 @@
 | 
			
		||||
 * note that T must already be properly LONGALIGN/SHORTALIGN'd for
 | 
			
		||||
 * this to work correctly.
 | 
			
		||||
 *
 | 
			
		||||
 * the double-cast is to stop gcc from (correctly) complaining about 
 | 
			
		||||
 * the double-cast is to stop gcc from (correctly) complaining about
 | 
			
		||||
 * casting integer types with size < sizeof(char *) to (char *).
 | 
			
		||||
 * sign-extension may get weird if you use an integer type that
 | 
			
		||||
 * isn't the same size as (char *) for the first cast.  (on the other
 | 
			
		||||
@@ -39,17 +39,17 @@
 | 
			
		||||
 *
 | 
			
		||||
 * attbyval seems to be fairly redundant.  We have to return a pointer if
 | 
			
		||||
 * the value is longer than 4 bytes or has variable length; returning the
 | 
			
		||||
 * value would be useless.  In fact, for at least the variable length case,
 | 
			
		||||
 * value would be useless.	In fact, for at least the variable length case,
 | 
			
		||||
 * the caller assumes we return a pointer regardless of attbyval.
 | 
			
		||||
 * I would eliminate attbyval altogether, but I don't know how.  -BRYANH.
 | 
			
		||||
 */
 | 
			
		||||
#define fetchatt(A, T) \
 | 
			
		||||
 ((*(A))->attbyval && (*(A))->attlen != -1 \
 | 
			
		||||
  ? ((*(A))->attlen > sizeof(int16) \
 | 
			
		||||
     ? (char *) (long) *((int32 *)(T)) \
 | 
			
		||||
     : ((*(A))->attlen < sizeof(int16) \
 | 
			
		||||
        ? (char *) (long) *((char *)(T)) \
 | 
			
		||||
        : (char *) (long) *((int16 *)(T)))) \
 | 
			
		||||
	 ? (char *) (long) *((int32 *)(T)) \
 | 
			
		||||
	 : ((*(A))->attlen < sizeof(int16) \
 | 
			
		||||
		? (char *) (long) *((char *)(T)) \
 | 
			
		||||
		: (char *) (long) *((int16 *)(T)))) \
 | 
			
		||||
  : (char *) (T))
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * valid.h--
 | 
			
		||||
 *    POSTGRES tuple qualification validity definitions.
 | 
			
		||||
 *	  POSTGRES tuple qualification validity definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: valid.h,v 1.4 1997/03/28 07:05:54 scrappy Exp $
 | 
			
		||||
 * $Id: valid.h,v 1.5 1997/09/07 04:56:18 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	VALID_H
 | 
			
		||||
#ifndef VALID_H
 | 
			
		||||
#define VALID_H
 | 
			
		||||
 | 
			
		||||
#include <utils/tqual.h>
 | 
			
		||||
@@ -18,18 +18,20 @@
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	extern decl's
 | 
			
		||||
 *		extern decl's
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
extern bool heap_keytest(HeapTuple t, TupleDesc tupdesc,
 | 
			
		||||
extern bool
 | 
			
		||||
heap_keytest(HeapTuple t, TupleDesc tupdesc,
 | 
			
		||||
			 int nkeys, ScanKey keys);
 | 
			
		||||
 | 
			
		||||
extern HeapTuple heap_tuple_satisfies(ItemId itemId, Relation relation,
 | 
			
		||||
				      Buffer buffer, PageHeader disk_page, 
 | 
			
		||||
				      TimeQual qual, int nKeys, 
 | 
			
		||||
				      ScanKey key);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
heap_tuple_satisfies(ItemId itemId, Relation relation,
 | 
			
		||||
					 Buffer buffer, PageHeader disk_page,
 | 
			
		||||
					 TimeQual qual, int nKeys,
 | 
			
		||||
					 ScanKey key);
 | 
			
		||||
 | 
			
		||||
extern bool TupleUpdatedByCurXactAndCmd(HeapTuple t);
 | 
			
		||||
extern bool		TupleUpdatedByCurXactAndCmd(HeapTuple t);
 | 
			
		||||
 | 
			
		||||
#endif	/* VALID_H */
 | 
			
		||||
#endif							/* VALID_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * xact.h--
 | 
			
		||||
 *    postgres transaction system header
 | 
			
		||||
 *	  postgres transaction system header
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: xact.h,v 1.6 1997/08/29 09:05:25 vadim Exp $
 | 
			
		||||
 * $Id: xact.h,v 1.7 1997/09/07 04:56:19 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -16,83 +16,85 @@
 | 
			
		||||
#include <utils/nabstime.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	transaction state structure
 | 
			
		||||
 *		transaction state structure
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct TransactionStateData {
 | 
			
		||||
    TransactionId	transactionIdData;
 | 
			
		||||
    CommandId		commandId;
 | 
			
		||||
    CommandId		scanCommandId;
 | 
			
		||||
    AbsoluteTime	startTime;
 | 
			
		||||
    int			state;
 | 
			
		||||
    int			blockState;
 | 
			
		||||
} TransactionStateData;
 | 
			
		||||
typedef struct TransactionStateData
 | 
			
		||||
{
 | 
			
		||||
	TransactionId	transactionIdData;
 | 
			
		||||
	CommandId		commandId;
 | 
			
		||||
	CommandId		scanCommandId;
 | 
			
		||||
	AbsoluteTime	startTime;
 | 
			
		||||
	int				state;
 | 
			
		||||
	int				blockState;
 | 
			
		||||
}				TransactionStateData;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	transaction states
 | 
			
		||||
 *		transaction states
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define TRANS_DEFAULT		0
 | 
			
		||||
#define TRANS_START		1
 | 
			
		||||
#define TRANS_INPROGRESS	2
 | 
			
		||||
#define TRANS_COMMIT		3
 | 
			
		||||
#define TRANS_ABORT		4
 | 
			
		||||
#define TRANS_DISABLED		5
 | 
			
		||||
#define TRANS_DEFAULT			0
 | 
			
		||||
#define TRANS_START				1
 | 
			
		||||
#define TRANS_INPROGRESS		2
 | 
			
		||||
#define TRANS_COMMIT			3
 | 
			
		||||
#define TRANS_ABORT				4
 | 
			
		||||
#define TRANS_DISABLED			5
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	transaction block states
 | 
			
		||||
 *		transaction block states
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define TBLOCK_DEFAULT		0
 | 
			
		||||
#define TBLOCK_BEGIN		1
 | 
			
		||||
#define TBLOCK_INPROGRESS	2
 | 
			
		||||
#define TBLOCK_END		3
 | 
			
		||||
#define TBLOCK_ABORT		4
 | 
			
		||||
#define TBLOCK_ENDABORT		5
 | 
			
		||||
#define TBLOCK_DEFAULT			0
 | 
			
		||||
#define TBLOCK_BEGIN			1
 | 
			
		||||
#define TBLOCK_INPROGRESS		2
 | 
			
		||||
#define TBLOCK_END				3
 | 
			
		||||
#define TBLOCK_ABORT			4
 | 
			
		||||
#define TBLOCK_ENDABORT			5
 | 
			
		||||
 | 
			
		||||
typedef TransactionStateData *TransactionState;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	extern definitions
 | 
			
		||||
 *		extern definitions
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
extern int TransactionFlushEnabled(void);
 | 
			
		||||
extern void SetTransactionFlushEnabled(bool state);
 | 
			
		||||
extern int		TransactionFlushEnabled(void);
 | 
			
		||||
extern void		SetTransactionFlushEnabled(bool state);
 | 
			
		||||
 | 
			
		||||
extern bool IsTransactionState(void);
 | 
			
		||||
extern bool IsAbortedTransactionBlockState(void);
 | 
			
		||||
extern void OverrideTransactionSystem(bool flag);
 | 
			
		||||
extern bool		IsTransactionState(void);
 | 
			
		||||
extern bool		IsAbortedTransactionBlockState(void);
 | 
			
		||||
extern void		OverrideTransactionSystem(bool flag);
 | 
			
		||||
extern TransactionId GetCurrentTransactionId(void);
 | 
			
		||||
extern CommandId GetCurrentCommandId(void);
 | 
			
		||||
extern CommandId GetScanCommandId(void);
 | 
			
		||||
extern void SetScanCommandId(CommandId);
 | 
			
		||||
extern void		SetScanCommandId(CommandId);
 | 
			
		||||
extern AbsoluteTime GetCurrentTransactionStartTime(void);
 | 
			
		||||
extern bool TransactionIdIsCurrentTransactionId(TransactionId xid);
 | 
			
		||||
extern bool CommandIdIsCurrentCommandId(CommandId cid);
 | 
			
		||||
extern bool CommandIdGEScanCommandId(CommandId cid);
 | 
			
		||||
extern void CommandCounterIncrement(void);
 | 
			
		||||
extern void InitializeTransactionSystem(void);
 | 
			
		||||
extern bool CurrentXactInProgress(void);
 | 
			
		||||
extern void StartTransactionCommand(void);
 | 
			
		||||
extern void CommitTransactionCommand(void);
 | 
			
		||||
extern void AbortCurrentTransaction(void);
 | 
			
		||||
extern void BeginTransactionBlock(void);
 | 
			
		||||
extern void EndTransactionBlock(void);
 | 
			
		||||
extern bool IsTransactionBlock(void);
 | 
			
		||||
extern void UserAbortTransactionBlock(void);
 | 
			
		||||
extern bool		TransactionIdIsCurrentTransactionId(TransactionId xid);
 | 
			
		||||
extern bool		CommandIdIsCurrentCommandId(CommandId cid);
 | 
			
		||||
extern bool		CommandIdGEScanCommandId(CommandId cid);
 | 
			
		||||
extern void		CommandCounterIncrement(void);
 | 
			
		||||
extern void		InitializeTransactionSystem(void);
 | 
			
		||||
extern bool		CurrentXactInProgress(void);
 | 
			
		||||
extern void		StartTransactionCommand(void);
 | 
			
		||||
extern void		CommitTransactionCommand(void);
 | 
			
		||||
extern void		AbortCurrentTransaction(void);
 | 
			
		||||
extern void		BeginTransactionBlock(void);
 | 
			
		||||
extern void		EndTransactionBlock(void);
 | 
			
		||||
extern bool		IsTransactionBlock(void);
 | 
			
		||||
extern void		UserAbortTransactionBlock(void);
 | 
			
		||||
 | 
			
		||||
extern TransactionId DisabledTransactionId;
 | 
			
		||||
 | 
			
		||||
/* defined in xid.c */
 | 
			
		||||
extern TransactionId xidin(char *representation);
 | 
			
		||||
extern char *xidout(TransactionId transactionId);
 | 
			
		||||
extern bool xideq(TransactionId xid1, TransactionId xid2);
 | 
			
		||||
extern bool TransactionIdIsValid(TransactionId transactionId);
 | 
			
		||||
extern void StoreInvalidTransactionId(TransactionId *destination);
 | 
			
		||||
extern void TransactionIdStore(TransactionId transactionId,
 | 
			
		||||
			       TransactionId *destination);
 | 
			
		||||
extern bool TransactionIdEquals(TransactionId id1, TransactionId id2);
 | 
			
		||||
extern bool TransactionIdIsLessThan(TransactionId id1, TransactionId id2);
 | 
			
		||||
extern void TransactionIdAdd(TransactionId *xid, int value);
 | 
			
		||||
extern char    *xidout(TransactionId transactionId);
 | 
			
		||||
extern bool		xideq(TransactionId xid1, TransactionId xid2);
 | 
			
		||||
extern bool		TransactionIdIsValid(TransactionId transactionId);
 | 
			
		||||
extern void		StoreInvalidTransactionId(TransactionId * destination);
 | 
			
		||||
extern void
 | 
			
		||||
TransactionIdStore(TransactionId transactionId,
 | 
			
		||||
				   TransactionId * destination);
 | 
			
		||||
extern bool		TransactionIdEquals(TransactionId id1, TransactionId id2);
 | 
			
		||||
extern bool		TransactionIdIsLessThan(TransactionId id1, TransactionId id2);
 | 
			
		||||
extern void		TransactionIdAdd(TransactionId * xid, int value);
 | 
			
		||||
 | 
			
		||||
#endif	/* XACT_H */
 | 
			
		||||
#endif							/* XACT_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * bootstrap.h--
 | 
			
		||||
 *    include file for the bootstrapping code
 | 
			
		||||
 *	  include file for the bootstrapping code
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: bootstrap.h,v 1.5 1997/08/19 21:37:42 momjian Exp $
 | 
			
		||||
 * $Id: bootstrap.h,v 1.6 1997/09/07 04:56:23 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -17,42 +17,44 @@
 | 
			
		||||
#include <access/itup.h>
 | 
			
		||||
#include <utils/rel.h>
 | 
			
		||||
 | 
			
		||||
#define	MAXATTR 40		/* max. number of attributes in a relation */
 | 
			
		||||
#define MAXATTR 40				/* max. number of attributes in a relation */
 | 
			
		||||
 | 
			
		||||
typedef struct hashnode {
 | 
			
		||||
    int		strnum;		/* Index into string table */
 | 
			
		||||
    struct hashnode	*next;
 | 
			
		||||
} hashnode;
 | 
			
		||||
typedef struct hashnode
 | 
			
		||||
{
 | 
			
		||||
	int				strnum;		/* Index into string table */
 | 
			
		||||
	struct hashnode *next;
 | 
			
		||||
}				hashnode;
 | 
			
		||||
 | 
			
		||||
#define EMITPROMPT printf("> ")
 | 
			
		||||
 | 
			
		||||
extern Relation reldesc;
 | 
			
		||||
extern AttributeTupleForm attrtypes[MAXATTR];
 | 
			
		||||
extern int numattr;
 | 
			
		||||
extern int DebugMode;
 | 
			
		||||
extern int		numattr;
 | 
			
		||||
extern int		DebugMode;
 | 
			
		||||
 | 
			
		||||
extern int BootstrapMain(int ac, char *av[]);
 | 
			
		||||
extern void index_register(char *heap,
 | 
			
		||||
extern int		BootstrapMain(int ac, char *av[]);
 | 
			
		||||
extern void
 | 
			
		||||
index_register(char *heap,
 | 
			
		||||
			   char *ind,
 | 
			
		||||
			   int natts,
 | 
			
		||||
			   AttrNumber *attnos,
 | 
			
		||||
			   AttrNumber * attnos,
 | 
			
		||||
			   uint16 nparams,
 | 
			
		||||
			   Datum *params,
 | 
			
		||||
			   FuncIndexInfo *finfo,
 | 
			
		||||
 			   PredInfo *predInfo);
 | 
			
		||||
			   Datum * params,
 | 
			
		||||
			   FuncIndexInfo * finfo,
 | 
			
		||||
			   PredInfo * predInfo);
 | 
			
		||||
 | 
			
		||||
extern void err_out(void);
 | 
			
		||||
extern void InsertOneTuple(Oid objectid);
 | 
			
		||||
extern void closerel(char *name);
 | 
			
		||||
extern void boot_openrel(char *name);
 | 
			
		||||
extern char *LexIDStr(int ident_num);
 | 
			
		||||
extern void		err_out(void);
 | 
			
		||||
extern void		InsertOneTuple(Oid objectid);
 | 
			
		||||
extern void		closerel(char *name);
 | 
			
		||||
extern void		boot_openrel(char *name);
 | 
			
		||||
extern char    *LexIDStr(int ident_num);
 | 
			
		||||
 | 
			
		||||
extern void DefineAttr(char *name, char *type, int attnum);
 | 
			
		||||
extern void InsertOneValue(Oid objectid, char *value, int i);
 | 
			
		||||
extern void InsertOneNull(int i);
 | 
			
		||||
extern char* MapArrayTypeName(char *s);
 | 
			
		||||
extern char* CleanUpStr(char *s);
 | 
			
		||||
extern int EnterString (char *str);
 | 
			
		||||
extern void build_indices(void);
 | 
			
		||||
extern void		DefineAttr(char *name, char *type, int attnum);
 | 
			
		||||
extern void		InsertOneValue(Oid objectid, char *value, int i);
 | 
			
		||||
extern void		InsertOneNull(int i);
 | 
			
		||||
extern char    *MapArrayTypeName(char *s);
 | 
			
		||||
extern char    *CleanUpStr(char *s);
 | 
			
		||||
extern int		EnterString(char *str);
 | 
			
		||||
extern void		build_indices(void);
 | 
			
		||||
 | 
			
		||||
#endif /* BOOTSTRAP_H */
 | 
			
		||||
#endif							/* BOOTSTRAP_H */
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										537
									
								
								src/include/c.h
									
									
									
									
									
								
							
							
						
						
									
										537
									
								
								src/include/c.h
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * catalog.h--
 | 
			
		||||
 *    prototypes for functions in lib/catalog/catalog.c
 | 
			
		||||
 *	  prototypes for functions in lib/catalog/catalog.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: catalog.h,v 1.2 1996/11/05 10:37:14 scrappy Exp $
 | 
			
		||||
 * $Id: catalog.h,v 1.3 1997/09/07 04:56:25 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -15,10 +15,10 @@
 | 
			
		||||
 | 
			
		||||
#include <access/tupdesc.h>
 | 
			
		||||
 | 
			
		||||
extern char *relpath(char relname[]);
 | 
			
		||||
extern bool IsSystemRelationName(char *relname);
 | 
			
		||||
extern bool IsSharedSystemRelationName(char *relname);
 | 
			
		||||
extern Oid newoid(void);
 | 
			
		||||
extern void fillatt(TupleDesc att);
 | 
			
		||||
extern char    *relpath(char relname[]);
 | 
			
		||||
extern bool		IsSystemRelationName(char *relname);
 | 
			
		||||
extern bool		IsSharedSystemRelationName(char *relname);
 | 
			
		||||
extern Oid		newoid(void);
 | 
			
		||||
extern void		fillatt(TupleDesc att);
 | 
			
		||||
 | 
			
		||||
#endif	/* CATALOG_H */
 | 
			
		||||
#endif							/* CATALOG_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * catname.h--
 | 
			
		||||
 *    POSTGRES system catalog relation name definitions.
 | 
			
		||||
 *	  POSTGRES system catalog relation name definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: catname.h,v 1.4 1997/09/01 08:09:09 vadim Exp $
 | 
			
		||||
 * $Id: catname.h,v 1.5 1997/09/07 04:56:27 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	CATNAME_H
 | 
			
		||||
#ifndef CATNAME_H
 | 
			
		||||
#define CATNAME_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -49,6 +49,6 @@
 | 
			
		||||
#define  RelCheckRelationName "pg_relcheck"
 | 
			
		||||
#define  TriggerRelationName "pg_trigger"
 | 
			
		||||
 | 
			
		||||
extern char *SharedSystemRelationNames[];
 | 
			
		||||
extern char    *SharedSystemRelationNames[];
 | 
			
		||||
 | 
			
		||||
#endif	/* CATNAME_H */
 | 
			
		||||
#endif							/* CATNAME_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * heap.h--
 | 
			
		||||
 *    prototypes for functions in lib/catalog/heap.c
 | 
			
		||||
 *	  prototypes for functions in lib/catalog/heap.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: heap.h,v 1.4 1997/08/19 21:37:47 momjian Exp $
 | 
			
		||||
 * $Id: heap.h,v 1.5 1997/09/07 04:56:29 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -17,15 +17,16 @@
 | 
			
		||||
 | 
			
		||||
extern Relation heap_creatr(char *relname, unsigned smgr, TupleDesc att);
 | 
			
		||||
 | 
			
		||||
extern Oid heap_create(char relname[], 
 | 
			
		||||
		       char *typename,
 | 
			
		||||
		       int arch, 
 | 
			
		||||
		       unsigned smgr, TupleDesc tupdesc);
 | 
			
		||||
extern Oid
 | 
			
		||||
heap_create(char relname[],
 | 
			
		||||
			char *typename,
 | 
			
		||||
			int arch,
 | 
			
		||||
			unsigned smgr, TupleDesc tupdesc);
 | 
			
		||||
 | 
			
		||||
extern void heap_destroy(char relname[]);
 | 
			
		||||
extern void heap_destroyr(Relation r);
 | 
			
		||||
 
 | 
			
		||||
extern void InitTempRelList(void);
 | 
			
		||||
extern void DestroyTempRels(void);
 | 
			
		||||
extern void		heap_destroy(char relname[]);
 | 
			
		||||
extern void		heap_destroyr(Relation r);
 | 
			
		||||
 | 
			
		||||
#endif	/* HEAP_H */
 | 
			
		||||
extern void		InitTempRelList(void);
 | 
			
		||||
extern void		DestroyTempRels(void);
 | 
			
		||||
 | 
			
		||||
#endif							/* HEAP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * index.h--
 | 
			
		||||
 *    prototypes for index.c.
 | 
			
		||||
 *	  prototypes for index.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: index.h,v 1.5 1997/03/19 07:36:35 vadim Exp $
 | 
			
		||||
 * $Id: index.h,v 1.6 1997/09/07 04:56:31 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	INDEX_H 
 | 
			
		||||
#ifndef INDEX_H
 | 
			
		||||
#define INDEX_H
 | 
			
		||||
 | 
			
		||||
#include <nodes/execnodes.h>
 | 
			
		||||
@@ -18,48 +18,53 @@
 | 
			
		||||
#include <access/itup.h>
 | 
			
		||||
#include <access/funcindex.h>
 | 
			
		||||
 | 
			
		||||
extern Form_pg_am
 | 
			
		||||
AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId);
 | 
			
		||||
extern			Form_pg_am
 | 
			
		||||
				AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId);
 | 
			
		||||
 | 
			
		||||
extern void
 | 
			
		||||
UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate);
 | 
			
		||||
				UpdateIndexPredicate(Oid indexoid, Node * oldPred, Node * predicate);
 | 
			
		||||
 | 
			
		||||
extern void InitIndexStrategy(int numatts,
 | 
			
		||||
			      Relation indexRelation,
 | 
			
		||||
			      Oid accessMethodObjectId);
 | 
			
		||||
extern void
 | 
			
		||||
InitIndexStrategy(int numatts,
 | 
			
		||||
				  Relation indexRelation,
 | 
			
		||||
				  Oid accessMethodObjectId);
 | 
			
		||||
 | 
			
		||||
extern void index_create(char *heapRelationName, 
 | 
			
		||||
			 char* indexRelationName,
 | 
			
		||||
			 FuncIndexInfo *funcInfo, 
 | 
			
		||||
			 List *attributeList,
 | 
			
		||||
extern void
 | 
			
		||||
index_create(char *heapRelationName,
 | 
			
		||||
			 char *indexRelationName,
 | 
			
		||||
			 FuncIndexInfo * funcInfo,
 | 
			
		||||
			 List * attributeList,
 | 
			
		||||
			 Oid accessMethodObjectId,
 | 
			
		||||
			 int numatts, 
 | 
			
		||||
			 int numatts,
 | 
			
		||||
			 AttrNumber attNums[],
 | 
			
		||||
			 Oid classObjectId[], 
 | 
			
		||||
			 Oid classObjectId[],
 | 
			
		||||
			 uint16 parameterCount,
 | 
			
		||||
			 Datum *parameter, 
 | 
			
		||||
			 Node *predicate,
 | 
			
		||||
			 Datum * parameter,
 | 
			
		||||
			 Node * predicate,
 | 
			
		||||
			 bool islossy,
 | 
			
		||||
			 bool unique);
 | 
			
		||||
 | 
			
		||||
extern void index_destroy(Oid indexId);
 | 
			
		||||
extern void		index_destroy(Oid indexId);
 | 
			
		||||
 | 
			
		||||
extern void FormIndexDatum(int numberOfAttributes,
 | 
			
		||||
	AttrNumber attributeNumber[], HeapTuple heapTuple,
 | 
			
		||||
	TupleDesc heapDescriptor, Buffer buffer, Datum *datum,
 | 
			
		||||
	char *nullv, FuncIndexInfoPtr fInfo);
 | 
			
		||||
extern void
 | 
			
		||||
FormIndexDatum(int numberOfAttributes,
 | 
			
		||||
			   AttrNumber attributeNumber[], HeapTuple heapTuple,
 | 
			
		||||
			   TupleDesc heapDescriptor, Buffer buffer, Datum * datum,
 | 
			
		||||
			   char *nullv, FuncIndexInfoPtr fInfo);
 | 
			
		||||
 | 
			
		||||
extern void UpdateStats(Oid relid, long reltuples, bool hasindex);
 | 
			
		||||
extern void		UpdateStats(Oid relid, long reltuples, bool hasindex);
 | 
			
		||||
 | 
			
		||||
extern void FillDummyExprContext(ExprContext *econtext, TupleTableSlot *slot,
 | 
			
		||||
			  TupleDesc tupdesc, Buffer buffer);
 | 
			
		||||
extern void
 | 
			
		||||
FillDummyExprContext(ExprContext * econtext, TupleTableSlot * slot,
 | 
			
		||||
					 TupleDesc tupdesc, Buffer buffer);
 | 
			
		||||
 | 
			
		||||
extern void index_build(Relation heapRelation, Relation indexRelation,
 | 
			
		||||
	int numberOfAttributes, AttrNumber attributeNumber[],
 | 
			
		||||
	uint16 parameterCount, Datum *parameter, FuncIndexInfo *funcInfo,
 | 
			
		||||
	PredInfo *predInfo);
 | 
			
		||||
extern void
 | 
			
		||||
index_build(Relation heapRelation, Relation indexRelation,
 | 
			
		||||
			int numberOfAttributes, AttrNumber attributeNumber[],
 | 
			
		||||
	  uint16 parameterCount, Datum * parameter, FuncIndexInfo * funcInfo,
 | 
			
		||||
			PredInfo * predInfo);
 | 
			
		||||
 | 
			
		||||
extern bool IndexIsUnique(Oid indexId);
 | 
			
		||||
extern bool IndexIsUniqueNoCache(Oid indexId);
 | 
			
		||||
extern bool		IndexIsUnique(Oid indexId);
 | 
			
		||||
extern bool		IndexIsUniqueNoCache(Oid indexId);
 | 
			
		||||
 | 
			
		||||
#endif /* INDEX_H */
 | 
			
		||||
#endif							/* INDEX_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * indexing.h--
 | 
			
		||||
 *    This include provides some definitions to support indexing 
 | 
			
		||||
 *    on system catalogs
 | 
			
		||||
 *	  This include provides some definitions to support indexing
 | 
			
		||||
 *	  on system catalogs
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: indexing.h,v 1.4 1997/08/31 09:55:20 vadim Exp $
 | 
			
		||||
 * $Id: indexing.h,v 1.5 1997/09/07 04:56:32 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -20,12 +20,12 @@
 | 
			
		||||
/*
 | 
			
		||||
 * Some definitions for indices on pg_attribute
 | 
			
		||||
 */
 | 
			
		||||
#define Num_pg_attr_indices	3
 | 
			
		||||
#define Num_pg_proc_indices	3
 | 
			
		||||
#define Num_pg_type_indices	2
 | 
			
		||||
#define Num_pg_attr_indices		3
 | 
			
		||||
#define Num_pg_proc_indices		3
 | 
			
		||||
#define Num_pg_type_indices		2
 | 
			
		||||
#define Num_pg_class_indices	2
 | 
			
		||||
#define Num_pg_attrdef_indices	1
 | 
			
		||||
#define Num_pg_relcheck_indices	1
 | 
			
		||||
#define Num_pg_relcheck_indices 1
 | 
			
		||||
#define Num_pg_trigger_indices	1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -38,48 +38,52 @@
 | 
			
		||||
#define ProcedureNameIndex "pg_procnameind"
 | 
			
		||||
#define ProcedureOidIndex  "pg_procidind"
 | 
			
		||||
#define ProcedureSrcIndex  "pg_procsrcind"
 | 
			
		||||
#define TypeNameIndex      "pg_typenameind"
 | 
			
		||||
#define TypeOidIndex       "pg_typeidind"
 | 
			
		||||
#define ClassNameIndex     "pg_classnameind"
 | 
			
		||||
#define ClassOidIndex      "pg_classoidind"
 | 
			
		||||
#define TypeNameIndex	   "pg_typenameind"
 | 
			
		||||
#define TypeOidIndex	   "pg_typeidind"
 | 
			
		||||
#define ClassNameIndex	   "pg_classnameind"
 | 
			
		||||
#define ClassOidIndex	   "pg_classoidind"
 | 
			
		||||
#define AttrDefaultIndex   "pg_attrdefind"
 | 
			
		||||
#define RelCheckIndex      "pg_relcheckind"
 | 
			
		||||
#define RelCheckIndex	   "pg_relcheckind"
 | 
			
		||||
#define TriggerRelidIndex  "pg_trigrelidind"
 | 
			
		||||
 | 
			
		||||
extern char *Name_pg_attr_indices[];
 | 
			
		||||
extern char *Name_pg_proc_indices[];
 | 
			
		||||
extern char *Name_pg_type_indices[];
 | 
			
		||||
extern char *Name_pg_class_indices[];
 | 
			
		||||
extern char *Name_pg_attrdef_indices[];
 | 
			
		||||
extern char *Name_pg_relcheck_indices[];
 | 
			
		||||
extern char *Name_pg_trigger_indices[];
 | 
			
		||||
extern char    *Name_pg_attr_indices[];
 | 
			
		||||
extern char    *Name_pg_proc_indices[];
 | 
			
		||||
extern char    *Name_pg_type_indices[];
 | 
			
		||||
extern char    *Name_pg_class_indices[];
 | 
			
		||||
extern char    *Name_pg_attrdef_indices[];
 | 
			
		||||
extern char    *Name_pg_relcheck_indices[];
 | 
			
		||||
extern char    *Name_pg_trigger_indices[];
 | 
			
		||||
 | 
			
		||||
extern char *IndexedCatalogNames[];
 | 
			
		||||
extern char    *IndexedCatalogNames[];
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * indexing.c prototypes 
 | 
			
		||||
 * indexing.c prototypes
 | 
			
		||||
 *
 | 
			
		||||
 * Functions for each index to perform the necessary scan on a cache miss.
 | 
			
		||||
 */
 | 
			
		||||
extern void CatalogOpenIndices(int nIndices, char *names[], Relation idescs[]);
 | 
			
		||||
extern void CatalogCloseIndices(int nIndices, Relation *idescs);
 | 
			
		||||
extern void CatalogIndexInsert(Relation *idescs,
 | 
			
		||||
			       int nIndices,
 | 
			
		||||
			       Relation heapRelation,
 | 
			
		||||
			       HeapTuple heapTuple);
 | 
			
		||||
extern bool CatalogHasIndex(char *catName, Oid catId);
 | 
			
		||||
extern void		CatalogOpenIndices(int nIndices, char *names[], Relation idescs[]);
 | 
			
		||||
extern void		CatalogCloseIndices(int nIndices, Relation * idescs);
 | 
			
		||||
extern void
 | 
			
		||||
CatalogIndexInsert(Relation * idescs,
 | 
			
		||||
				   int nIndices,
 | 
			
		||||
				   Relation heapRelation,
 | 
			
		||||
				   HeapTuple heapTuple);
 | 
			
		||||
extern bool		CatalogHasIndex(char *catName, Oid catId);
 | 
			
		||||
 | 
			
		||||
extern HeapTuple AttributeNameIndexScan(Relation heapRelation,
 | 
			
		||||
					Oid relid,
 | 
			
		||||
					char *attname);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
AttributeNameIndexScan(Relation heapRelation,
 | 
			
		||||
					   Oid relid,
 | 
			
		||||
					   char *attname);
 | 
			
		||||
 | 
			
		||||
extern HeapTuple AttributeNumIndexScan(Relation heapRelation,
 | 
			
		||||
				       Oid relid,
 | 
			
		||||
				       AttrNumber attnum);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
AttributeNumIndexScan(Relation heapRelation,
 | 
			
		||||
					  Oid relid,
 | 
			
		||||
					  AttrNumber attnum);
 | 
			
		||||
extern HeapTuple ProcedureOidIndexScan(Relation heapRelation, Oid procId);
 | 
			
		||||
extern HeapTuple ProcedureNameIndexScan(Relation heapRelation,
 | 
			
		||||
	char *procName, int nargs, Oid *argTypes);
 | 
			
		||||
extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text *procSrc);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
ProcedureNameIndexScan(Relation heapRelation,
 | 
			
		||||
					   char *procName, int nargs, Oid * argTypes);
 | 
			
		||||
extern HeapTuple ProcedureSrcIndexScan(Relation heapRelation, text * procSrc);
 | 
			
		||||
extern HeapTuple TypeOidIndexScan(Relation heapRelation, Oid typeId);
 | 
			
		||||
extern HeapTuple TypeNameIndexScan(Relation heapRelation, char *typeName);
 | 
			
		||||
extern HeapTuple ClassNameIndexScan(Relation heapRelation, char *relName);
 | 
			
		||||
@@ -93,26 +97,26 @@ extern HeapTuple ClassOidIndexScan(Relation heapRelation, Oid relId);
 | 
			
		||||
 * The keyword is DECLARE_INDEX every thing after that is just like in a
 | 
			
		||||
 * normal specification of the 'define index' POSTQUEL command.
 | 
			
		||||
 */
 | 
			
		||||
DECLARE_INDEX(pg_attnameind on pg_attribute using btree (mkoidname(attrelid, attname) oidname_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attnumind  on pg_attribute using btree (mkoidint2(attrelid, attnum) oidint2_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attrelidind on pg_attribute using btree (attrelid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attnameind on pg_attribute using btree(mkoidname(attrelid, attname) oidname_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attnumind on pg_attribute using btree(mkoidint2(attrelid, attnum) oidint2_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attrelidind on pg_attribute using btree(attrelid oid_ops));
 | 
			
		||||
 | 
			
		||||
DECLARE_INDEX(pg_procidind on pg_proc using btree (Oid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_procnameind on pg_proc using btree (proname name_ops));
 | 
			
		||||
DECLARE_INDEX(pg_procsrcind on pg_proc using btree (prosrc text_ops));
 | 
			
		||||
DECLARE_INDEX(pg_procidind on pg_proc using btree(Oid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_procnameind on pg_proc using btree(proname name_ops));
 | 
			
		||||
DECLARE_INDEX(pg_procsrcind on pg_proc using btree(prosrc text_ops));
 | 
			
		||||
 | 
			
		||||
DECLARE_INDEX(pg_typeidind on pg_type using btree (Oid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_typenameind on pg_type using btree (typname name_ops));
 | 
			
		||||
DECLARE_INDEX(pg_typeidind on pg_type using btree(Oid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_typenameind on pg_type using btree(typname name_ops));
 | 
			
		||||
 | 
			
		||||
DECLARE_INDEX(pg_classnameind on pg_class using btree (relname name_ops));
 | 
			
		||||
DECLARE_INDEX(pg_classoidind on pg_class using btree (Oid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_classnameind on pg_class using btree(relname name_ops));
 | 
			
		||||
DECLARE_INDEX(pg_classoidind on pg_class using btree(Oid oid_ops));
 | 
			
		||||
 | 
			
		||||
DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree (adrelid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree (rcrelid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_attrdefind on pg_attrdef using btree(adrelid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_relcheckind on pg_relcheck using btree(rcrelid oid_ops));
 | 
			
		||||
 | 
			
		||||
DECLARE_INDEX(pg_trigrelidind on pg_trigger using btree (tgrelid oid_ops));
 | 
			
		||||
DECLARE_INDEX(pg_trigrelidind on pg_trigger using btree(tgrelid oid_ops));
 | 
			
		||||
 | 
			
		||||
/* now build indices in the initialization scripts */
 | 
			
		||||
BUILD_INDICES
 | 
			
		||||
 | 
			
		||||
#endif /* INDEXING_H */
 | 
			
		||||
#endif							/* INDEXING_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_aggregate.h--
 | 
			
		||||
 *    definition of the system "aggregate" relation (pg_aggregate)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "aggregate" relation (pg_aggregate)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_aggregate.h,v 1.8 1997/08/21 23:56:45 momjian Exp $
 | 
			
		||||
 * $Id: pg_aggregate.h,v 1.9 1997/09/07 04:56:36 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,64 +19,65 @@
 | 
			
		||||
#define PG_AGGREGATE_H
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	postgres.h contains the system type definitions and the
 | 
			
		||||
 *	CATALOG(), BOOTSTRAP and DATA() sugar words so this file
 | 
			
		||||
 *	can be read by both genbki.sh and the C compiler.
 | 
			
		||||
 *		postgres.h contains the system type definitions and the
 | 
			
		||||
 *		CATALOG(), BOOTSTRAP and DATA() sugar words so this file
 | 
			
		||||
 *		can be read by both genbki.sh and the C compiler.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *	pg_aggregate definition.
 | 
			
		||||
 *		pg_aggregate definition.
 | 
			
		||||
 *
 | 
			
		||||
 *	cpp turns this into typedef struct FormData_pg_aggregate
 | 
			
		||||
 *		cpp turns this into typedef struct FormData_pg_aggregate
 | 
			
		||||
 *
 | 
			
		||||
 *  aggname		name of the aggregate
 | 
			
		||||
 *  aggtransfn1		transition function 1
 | 
			
		||||
 *  aggtransfn2		transition function 2
 | 
			
		||||
 *  aggfinalfn		final function
 | 
			
		||||
 *  aggbasetype		type of data on which aggregate operates
 | 
			
		||||
 *  aggtranstype1	output types for transition func 1
 | 
			
		||||
 *  aggtranstype2	output types for transition func 2
 | 
			
		||||
 *  aggfinaltype	output type for final function
 | 
			
		||||
 *  agginitval1		initial aggregate value
 | 
			
		||||
 *  agginitval2		initial value for transition state 2
 | 
			
		||||
 *	aggname				name of the aggregate
 | 
			
		||||
 *	aggtransfn1			transition function 1
 | 
			
		||||
 *	aggtransfn2			transition function 2
 | 
			
		||||
 *	aggfinalfn			final function
 | 
			
		||||
 *	aggbasetype			type of data on which aggregate operates
 | 
			
		||||
 *	aggtranstype1		output types for transition func 1
 | 
			
		||||
 *	aggtranstype2		output types for transition func 2
 | 
			
		||||
 *	aggfinaltype		output type for final function
 | 
			
		||||
 *	agginitval1			initial aggregate value
 | 
			
		||||
 *	agginitval2			initial value for transition state 2
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_aggregate) {
 | 
			
		||||
    NameData 		aggname;
 | 
			
		||||
    Oid			aggowner;
 | 
			
		||||
    regproc	 	aggtransfn1;
 | 
			
		||||
    regproc		aggtransfn2;
 | 
			
		||||
    regproc 		aggfinalfn;
 | 
			
		||||
    Oid			aggbasetype;
 | 
			
		||||
    Oid			aggtranstype1;
 | 
			
		||||
    Oid			aggtranstype2;
 | 
			
		||||
    Oid			aggfinaltype;
 | 
			
		||||
    text		agginitval1;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
    text		agginitval2;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_aggregate)
 | 
			
		||||
{
 | 
			
		||||
	NameData		aggname;
 | 
			
		||||
	Oid				aggowner;
 | 
			
		||||
	regproc			aggtransfn1;
 | 
			
		||||
	regproc			aggtransfn2;
 | 
			
		||||
	regproc			aggfinalfn;
 | 
			
		||||
	Oid				aggbasetype;
 | 
			
		||||
	Oid				aggtranstype1;
 | 
			
		||||
	Oid				aggtranstype2;
 | 
			
		||||
	Oid				aggfinaltype;
 | 
			
		||||
	text			agginitval1;/* VARIABLE LENGTH FIELD */
 | 
			
		||||
	text			agginitval2;/* VARIABLE LENGTH FIELD */
 | 
			
		||||
} FormData_pg_aggregate;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_aggregate corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_aggregate relation.
 | 
			
		||||
 *		Form_pg_aggregate corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_aggregate relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_aggregate	*Form_pg_aggregate;
 | 
			
		||||
typedef FormData_pg_aggregate *Form_pg_aggregate;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_aggregate
 | 
			
		||||
 *		compiler constants for pg_aggregate
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_aggregate		11
 | 
			
		||||
#define Anum_pg_aggregate_aggname	1
 | 
			
		||||
#define Anum_pg_aggregate_aggowner	2
 | 
			
		||||
#define Natts_pg_aggregate				11
 | 
			
		||||
#define Anum_pg_aggregate_aggname		1
 | 
			
		||||
#define Anum_pg_aggregate_aggowner		2
 | 
			
		||||
#define Anum_pg_aggregate_aggtransfn1	3
 | 
			
		||||
#define Anum_pg_aggregate_aggtransfn2	4
 | 
			
		||||
#define Anum_pg_aggregate_aggfinalfn	5
 | 
			
		||||
#define Anum_pg_aggregate_aggbasetype	6
 | 
			
		||||
#define Anum_pg_aggregate_aggtranstype1	7
 | 
			
		||||
#define Anum_pg_aggregate_aggtranstype2	8
 | 
			
		||||
#define Anum_pg_aggregate_aggtranstype1 7
 | 
			
		||||
#define Anum_pg_aggregate_aggtranstype2 8
 | 
			
		||||
#define Anum_pg_aggregate_aggfinaltype	9
 | 
			
		||||
#define Anum_pg_aggregate_agginitval1	10
 | 
			
		||||
#define Anum_pg_aggregate_agginitval2	11
 | 
			
		||||
@@ -87,57 +88,59 @@ typedef FormData_pg_aggregate	*Form_pg_aggregate;
 | 
			
		||||
 * ---------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID int4pl   int4inc   int4div     23   23   23   23 _null_ 0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID int2pl   int2inc   int2div     21   21   21   21 _null_ 0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID float4pl float4inc float4div  700  700  700  700 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID float8pl float8inc float8div  701  701  701  701 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID cash_pl  float8inc cash_div   790  790  701  790 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg   PGUID timespan_pl  float8inc timespan_div   1186  1186  701  1186 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID int4pl   int4inc	 int4div	 23   23   23	23 _null_ 0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID int2pl   int2inc	 int2div	 21   21   21	21 _null_ 0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID float4pl float4inc float4div	700  700  700  700 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID float8pl float8inc float8div	701  701  701  701 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID cash_pl  float8inc cash_div	790  790  701  790 _null_ 0.0 ));
 | 
			
		||||
DATA(insert OID = 0 ( avg	PGUID timespan_pl  float8inc timespan_div	1186  1186	701  1186 _null_ 0.0 ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID int4pl        - -   23   23 0   23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID int2pl        - -   21   21 0   21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID float4pl      - -  700  700 0  700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID float8pl      - -  701  701 0  701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID cash_pl       - -  790  790 0  790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum   PGUID timespan_pl   - -  1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID int4pl		- -   23   23 0   23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID int2pl		- -   21   21 0   21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID float4pl		- -  700  700 0  700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID float8pl		- -  701  701 0  701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID cash_pl		- -  790  790 0  790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( sum	PGUID timespan_pl	- -  1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID int4larger      - -   23   23 0   23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID int2larger      - -   21   21 0   21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID float4larger    - -  700  700 0  700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID float8larger    - -  701  701 0  701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID int4larger      - -  702  702 0  702 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID date_larger     - - 1082 1082 0 1082 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID float8larger    - - 1084 1084 0 1084 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID cashlarger      - -  790  790 0  790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID datetime_larger - - 1184 1184 0 1184 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max   PGUID timespan_larger - - 1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID int4larger	  - -	23	 23 0	23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID int2larger	  - -	21	 21 0	21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID float4larger	  - -  700	700 0  700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID float8larger	  - -  701	701 0  701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID int4larger	  - -  702	702 0  702 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID date_larger	  - - 1082 1082 0 1082 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID float8larger	  - - 1084 1084 0 1084 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID cashlarger	  - -  790	790 0  790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID datetime_larger - - 1184 1184 0 1184 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( max	PGUID timespan_larger - - 1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID int4smaller      - -   23   23 0   23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID int2smaller      - -   21   21 0   21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID float4smaller    - -  700  700 0  700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID float8smaller    - -  701  701 0  701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID int4smaller      - -  702  702 0  702 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID date_smaller     - - 1082 1082 0 1082 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID float8smaller    - - 1084 1084 0 1084 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID cashsmaller      - -  790  790 0  790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID datetime_smaller - - 1184 1184 0 1184 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min   PGUID timespan_smaller - - 1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID int4smaller	   - -	 23   23 0	 23 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID int2smaller	   - -	 21   21 0	 21 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID float4smaller    - -	700  700 0	700 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID float8smaller    - -	701  701 0	701 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID int4smaller	   - -	702  702 0	702 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID date_smaller	   - - 1082 1082 0 1082 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID float8smaller    - - 1084 1084 0 1084 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID cashsmaller	   - -	790  790 0	790 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID datetime_smaller - - 1184 1184 0 1184 _null_ _null_ ));
 | 
			
		||||
DATA(insert OID = 0 ( min	PGUID timespan_smaller - - 1186 1186 0 1186 _null_ _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 ( count PGUID - int4inc - 0 0 23 23 _null_ 0 ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in pg_aggregate.c
 | 
			
		||||
 */
 | 
			
		||||
extern void AggregateCreate(char *aggName, 
 | 
			
		||||
			    char *aggtransfn1Name,
 | 
			
		||||
			    char *aggtransfn2Name,
 | 
			
		||||
			    char *aggfinalfnName,
 | 
			
		||||
			    char *aggbasetypeName,
 | 
			
		||||
			    char *aggtransfn1typeName,
 | 
			
		||||
			    char *aggtransfn2typeName,
 | 
			
		||||
			    char *agginitval1,
 | 
			
		||||
			    char *agginitval2);
 | 
			
		||||
extern char *AggNameGetInitVal(char *aggName, Oid basetype, 
 | 
			
		||||
			       int xfuncno, bool *isNull);
 | 
			
		||||
extern void
 | 
			
		||||
AggregateCreate(char *aggName,
 | 
			
		||||
				char *aggtransfn1Name,
 | 
			
		||||
				char *aggtransfn2Name,
 | 
			
		||||
				char *aggfinalfnName,
 | 
			
		||||
				char *aggbasetypeName,
 | 
			
		||||
				char *aggtransfn1typeName,
 | 
			
		||||
				char *aggtransfn2typeName,
 | 
			
		||||
				char *agginitval1,
 | 
			
		||||
				char *agginitval2);
 | 
			
		||||
extern char    *
 | 
			
		||||
AggNameGetInitVal(char *aggName, Oid basetype,
 | 
			
		||||
				  int xfuncno, bool * isNull);
 | 
			
		||||
 | 
			
		||||
#endif /* PG_AGGREGATE_H */
 | 
			
		||||
#endif							/* PG_AGGREGATE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,20 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_am.h--
 | 
			
		||||
 *    definition of the system "am" relation (pg_am)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "am" relation (pg_am)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_am.h,v 1.2 1996/10/31 09:47:07 scrappy Exp $
 | 
			
		||||
 * $Id: pg_am.h,v 1.3 1997/09/07 04:56:37 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *	the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	information from the DATA() statements.
 | 
			
		||||
 *		the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *		information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *	XXX do NOT break up DATA() statements into multiple lines!
 | 
			
		||||
 *	    the scripts are not as smart as you might think...
 | 
			
		||||
 *		XXX do NOT break up DATA() statements into multiple lines!
 | 
			
		||||
 *			the scripts are not as smart as you might think...
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -22,79 +22,80 @@
 | 
			
		||||
#define PG_AM_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_am definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_am
 | 
			
		||||
 *		pg_am definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_am
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_am) {
 | 
			
		||||
    NameData	amname;
 | 
			
		||||
    Oid 	amowner;
 | 
			
		||||
    char	amkind;
 | 
			
		||||
    int2 	amstrategies;
 | 
			
		||||
    int2 	amsupport;
 | 
			
		||||
    regproc 	amgettuple;
 | 
			
		||||
    regproc	aminsert;
 | 
			
		||||
    regproc 	amdelete;
 | 
			
		||||
    regproc 	amgetattr;
 | 
			
		||||
    regproc 	amsetlock;
 | 
			
		||||
    regproc 	amsettid;
 | 
			
		||||
    regproc	amfreetuple;
 | 
			
		||||
    regproc 	ambeginscan;
 | 
			
		||||
    regproc 	amrescan;
 | 
			
		||||
    regproc 	amendscan;
 | 
			
		||||
    regproc 	ammarkpos;
 | 
			
		||||
    regproc 	amrestrpos;
 | 
			
		||||
    regproc 	amopen;
 | 
			
		||||
    regproc 	amclose;
 | 
			
		||||
    regproc 	ambuild;
 | 
			
		||||
    regproc 	amcreate; 
 | 
			
		||||
    regproc 	amdestroy;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_am)
 | 
			
		||||
{
 | 
			
		||||
	NameData		amname;
 | 
			
		||||
	Oid				amowner;
 | 
			
		||||
	char			amkind;
 | 
			
		||||
	int2			amstrategies;
 | 
			
		||||
	int2			amsupport;
 | 
			
		||||
	regproc			amgettuple;
 | 
			
		||||
	regproc			aminsert;
 | 
			
		||||
	regproc			amdelete;
 | 
			
		||||
	regproc			amgetattr;
 | 
			
		||||
	regproc			amsetlock;
 | 
			
		||||
	regproc			amsettid;
 | 
			
		||||
	regproc			amfreetuple;
 | 
			
		||||
	regproc			ambeginscan;
 | 
			
		||||
	regproc			amrescan;
 | 
			
		||||
	regproc			amendscan;
 | 
			
		||||
	regproc			ammarkpos;
 | 
			
		||||
	regproc			amrestrpos;
 | 
			
		||||
	regproc			amopen;
 | 
			
		||||
	regproc			amclose;
 | 
			
		||||
	regproc			ambuild;
 | 
			
		||||
	regproc			amcreate;
 | 
			
		||||
	regproc			amdestroy;
 | 
			
		||||
} FormData_pg_am;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_am corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_am relation.
 | 
			
		||||
 *		Form_pg_am corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_am relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_am	*Form_pg_am;
 | 
			
		||||
typedef FormData_pg_am *Form_pg_am;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_am
 | 
			
		||||
 *		compiler constants for pg_am
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_am			22
 | 
			
		||||
#define Anum_pg_am_amname		1
 | 
			
		||||
#define Anum_pg_am_amowner		2
 | 
			
		||||
#define Anum_pg_am_amkind		3
 | 
			
		||||
#define Anum_pg_am_amstrategies		4
 | 
			
		||||
#define Anum_pg_am_amsupport		5
 | 
			
		||||
#define Anum_pg_am_amgettuple		6
 | 
			
		||||
#define Anum_pg_am_aminsert		7
 | 
			
		||||
#define Anum_pg_am_amdelete		8
 | 
			
		||||
#define Anum_pg_am_amgetattr		9
 | 
			
		||||
#define Anum_pg_am_amsetlock		10
 | 
			
		||||
#define Anum_pg_am_amsettid		11
 | 
			
		||||
#define Anum_pg_am_amfreetuple		12
 | 
			
		||||
#define Anum_pg_am_ambeginscan		13
 | 
			
		||||
#define Anum_pg_am_amrescan		14
 | 
			
		||||
#define Anum_pg_am_amendscan		15
 | 
			
		||||
#define Anum_pg_am_ammarkpos		16
 | 
			
		||||
#define Anum_pg_am_amrestrpos		17
 | 
			
		||||
#define Anum_pg_am_amopen		18
 | 
			
		||||
#define Anum_pg_am_amclose		19
 | 
			
		||||
#define Anum_pg_am_ambuild		20
 | 
			
		||||
#define Anum_pg_am_amcreate		21
 | 
			
		||||
#define Anum_pg_am_amdestroy		22
 | 
			
		||||
#define Natts_pg_am						22
 | 
			
		||||
#define Anum_pg_am_amname				1
 | 
			
		||||
#define Anum_pg_am_amowner				2
 | 
			
		||||
#define Anum_pg_am_amkind				3
 | 
			
		||||
#define Anum_pg_am_amstrategies			4
 | 
			
		||||
#define Anum_pg_am_amsupport			5
 | 
			
		||||
#define Anum_pg_am_amgettuple			6
 | 
			
		||||
#define Anum_pg_am_aminsert				7
 | 
			
		||||
#define Anum_pg_am_amdelete				8
 | 
			
		||||
#define Anum_pg_am_amgetattr			9
 | 
			
		||||
#define Anum_pg_am_amsetlock			10
 | 
			
		||||
#define Anum_pg_am_amsettid				11
 | 
			
		||||
#define Anum_pg_am_amfreetuple			12
 | 
			
		||||
#define Anum_pg_am_ambeginscan			13
 | 
			
		||||
#define Anum_pg_am_amrescan				14
 | 
			
		||||
#define Anum_pg_am_amendscan			15
 | 
			
		||||
#define Anum_pg_am_ammarkpos			16
 | 
			
		||||
#define Anum_pg_am_amrestrpos			17
 | 
			
		||||
#define Anum_pg_am_amopen				18
 | 
			
		||||
#define Anum_pg_am_amclose				19
 | 
			
		||||
#define Anum_pg_am_ambuild				20
 | 
			
		||||
#define Anum_pg_am_amcreate				21
 | 
			
		||||
#define Anum_pg_am_amdestroy			22
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_am
 | 
			
		||||
 *		initial contents of pg_am
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -109,7 +110,7 @@ BKI_BEGIN
 | 
			
		||||
BKI_END
 | 
			
		||||
DATA(insert OID = 404 (  nobtree PGUID "o" 5 1 nobtgettuple nobtinsert nobtdelete - - - - nobtbeginscan nobtrescan nobtendscan nobtmarkpos nobtrestrpos - - nobtbuild - - ));
 | 
			
		||||
BKI_BEGIN
 | 
			
		||||
#endif /* NOBTREE */
 | 
			
		||||
#endif							/* NOBTREE */
 | 
			
		||||
BKI_END
 | 
			
		||||
 | 
			
		||||
#endif /* PG_AM_H */
 | 
			
		||||
#endif							/* PG_AM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_amop.h--
 | 
			
		||||
 *    definition of the system "amop" relation (pg_amop)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "amop" relation (pg_amop)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_amop.h,v 1.5 1997/09/04 18:43:57 thomas Exp $
 | 
			
		||||
 * $Id: pg_amop.h,v 1.6 1997/09/07 04:56:37 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *   the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *   information from the DATA() statements.
 | 
			
		||||
 *	 the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	 information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,53 +19,54 @@
 | 
			
		||||
#define PG_AMOP_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_amop definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_amop
 | 
			
		||||
 *		pg_amop definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_amop
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_amop) {
 | 
			
		||||
    Oid 	amopid;
 | 
			
		||||
    Oid 	amopclaid;
 | 
			
		||||
    Oid 	amopopr;
 | 
			
		||||
    int2 	amopstrategy;
 | 
			
		||||
    regproc 	amopselect;
 | 
			
		||||
    regproc 	amopnpages;  
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_amop)
 | 
			
		||||
{
 | 
			
		||||
	Oid				amopid;
 | 
			
		||||
	Oid				amopclaid;
 | 
			
		||||
	Oid				amopopr;
 | 
			
		||||
	int2			amopstrategy;
 | 
			
		||||
	regproc			amopselect;
 | 
			
		||||
	regproc			amopnpages;
 | 
			
		||||
} FormData_pg_amop;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_amop corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_amop relation.
 | 
			
		||||
 *		Form_pg_amop corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_amop relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_amop	*Form_pg_amop;
 | 
			
		||||
typedef FormData_pg_amop *Form_pg_amop;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_amop
 | 
			
		||||
 *		compiler constants for pg_amop
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
/* #define Name_pg_amop			"pg_amop" */
 | 
			
		||||
#define Natts_pg_amop			6
 | 
			
		||||
#define Anum_pg_amop_amopid   		1
 | 
			
		||||
#define Anum_pg_amop_amopclaid 		2
 | 
			
		||||
#define Anum_pg_amop_amopopr		3
 | 
			
		||||
#define Anum_pg_amop_amopstrategy	4
 | 
			
		||||
#define Anum_pg_amop_amopselect		5
 | 
			
		||||
#define Anum_pg_amop_amopnpages		6
 | 
			
		||||
/* #define Name_pg_amop					"pg_amop" */
 | 
			
		||||
#define Natts_pg_amop					6
 | 
			
		||||
#define Anum_pg_amop_amopid				1
 | 
			
		||||
#define Anum_pg_amop_amopclaid			2
 | 
			
		||||
#define Anum_pg_amop_amopopr			3
 | 
			
		||||
#define Anum_pg_amop_amopstrategy		4
 | 
			
		||||
#define Anum_pg_amop_amopselect			5
 | 
			
		||||
#define Anum_pg_amop_amopnpages			6
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_amop
 | 
			
		||||
 *		initial contents of pg_amop
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  rtree box_ops
 | 
			
		||||
 *	rtree box_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  402 422 493 1 rtsel rtnpage ));
 | 
			
		||||
@@ -78,7 +79,7 @@ DATA(insert OID = 0 (  402 422 498 7 rtsel rtnpage ));
 | 
			
		||||
DATA(insert OID = 0 (  402 422 497 8 rtsel rtnpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  rtree bigbox_ops
 | 
			
		||||
 *	rtree bigbox_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  402 433 493 1 rtsel rtnpage ));
 | 
			
		||||
@@ -91,7 +92,7 @@ DATA(insert OID = 0 (  402 433 498 7 rtsel rtnpage ));
 | 
			
		||||
DATA(insert OID = 0 (  402 433 497 8 rtsel rtnpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  rtree poly_ops (supports polygons)
 | 
			
		||||
 *	rtree poly_ops (supports polygons)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  402 434 485 1 rtsel rtnpage ));
 | 
			
		||||
@@ -104,7 +105,7 @@ DATA(insert OID = 0 (  402 434 491 7 rtsel rtnpage ));
 | 
			
		||||
DATA(insert OID = 0 (  402 434 492 8 rtsel rtnpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  rtree circle_ops (supports circles)
 | 
			
		||||
 *	rtree circle_ops (supports circles)
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  402 714 1506 1 rtsel rtnpage ));
 | 
			
		||||
@@ -117,17 +118,17 @@ DATA(insert OID = 0 (  402 714 1512 7 rtsel rtnpage ));
 | 
			
		||||
DATA(insert OID = 0 (  402 714 1513 8 rtsel rtnpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree int2_ops
 | 
			
		||||
 *	nbtree int2_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 421  95 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421	95 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421 522 2 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421  94 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421	94 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421 524 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 421 520 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree float8_ops
 | 
			
		||||
 *	nbtree float8_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 423 672 1 btreesel btreenpage ));
 | 
			
		||||
@@ -137,7 +138,7 @@ DATA(insert OID = 0 (  403 423 675 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 423 674 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree int24_ops
 | 
			
		||||
 *	nbtree int24_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 424 534 1 btreesel btreenpage ));
 | 
			
		||||
@@ -147,7 +148,7 @@ DATA(insert OID = 0 (  403 424 542 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 424 536 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree int42_ops
 | 
			
		||||
 *	nbtree int42_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 425 535 1 btreesel btreenpage ));
 | 
			
		||||
@@ -157,17 +158,17 @@ DATA(insert OID = 0 (  403 425 543 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 425 537 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree int4_ops
 | 
			
		||||
 *	nbtree int4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 426  97 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426	97 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426 523 2 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426  96 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426	96 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426 525 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 426 521 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree oid_ops
 | 
			
		||||
 *	nbtree oid_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 427 609 1 btreesel btreenpage ));
 | 
			
		||||
@@ -177,7 +178,7 @@ DATA(insert OID = 0 (  403 427 612 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 427 610 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree float4_ops
 | 
			
		||||
 *	nbtree float4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 428 622 1 btreesel btreenpage ));
 | 
			
		||||
@@ -187,7 +188,7 @@ DATA(insert OID = 0 (  403 428 625 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 428 623 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree char_ops
 | 
			
		||||
 *	nbtree char_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 429 631 1 btreesel btreenpage ));
 | 
			
		||||
@@ -197,7 +198,7 @@ DATA(insert OID = 0 (  403 429 634 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 429 633 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree char2_ops
 | 
			
		||||
 *	nbtree char2_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 406 418 1 btreesel btreenpage ));
 | 
			
		||||
@@ -207,7 +208,7 @@ DATA(insert OID = 0 (  403 406 463 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 406 460 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree char4_ops
 | 
			
		||||
 *	nbtree char4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 407 419 1 btreesel btreenpage ));
 | 
			
		||||
@@ -217,7 +218,7 @@ DATA(insert OID = 0 (  403 407 464 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 407 461 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree char8_ops
 | 
			
		||||
 *	nbtree char8_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 408 420 1 btreesel btreenpage ));
 | 
			
		||||
@@ -227,7 +228,7 @@ DATA(insert OID = 0 (  403 408 465 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 408 462 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree name_ops
 | 
			
		||||
 *	nbtree name_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1181 660 1 btreesel btreenpage ));
 | 
			
		||||
@@ -237,7 +238,7 @@ DATA(insert OID = 0 (  403 1181 663 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 1181 662 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree char16_ops
 | 
			
		||||
 *	nbtree char16_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 430 645 1 btreesel btreenpage ));
 | 
			
		||||
@@ -247,7 +248,7 @@ DATA(insert OID = 0 (  403 430 648 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 430 647 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree text_ops
 | 
			
		||||
 *	nbtree text_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 431 664 1 btreesel btreenpage ));
 | 
			
		||||
@@ -257,7 +258,7 @@ DATA(insert OID = 0 (  403 431 667 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 431 666 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree abstime_ops
 | 
			
		||||
 *	nbtree abstime_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 432 562 1 btreesel btreenpage ));
 | 
			
		||||
@@ -267,7 +268,7 @@ DATA(insert OID = 0 (  403 432 565 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 432 563 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree oidint4_ops
 | 
			
		||||
 *	nbtree oidint4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 435 930 1 btreesel btreenpage ));
 | 
			
		||||
@@ -277,7 +278,7 @@ DATA(insert OID = 0 (  403 435 933 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 435 934 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree oidint2_ops
 | 
			
		||||
 *	nbtree oidint2_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 437 830 1 btreesel btreenpage ));
 | 
			
		||||
@@ -287,7 +288,7 @@ DATA(insert OID = 0 (  403 437 833 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 437 834 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree oidname_ops
 | 
			
		||||
 *	nbtree oidname_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 436 676 1 btreesel btreenpage ));
 | 
			
		||||
@@ -297,7 +298,7 @@ DATA(insert OID = 0 (  403 436 679 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 436 680 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree bpchar_ops
 | 
			
		||||
 *	nbtree bpchar_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1076 1058 1 btreesel btreenpage ));
 | 
			
		||||
@@ -307,7 +308,7 @@ DATA(insert OID = 0 (  403 1076 1061 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 1076 1060 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree varchar_ops
 | 
			
		||||
 *	nbtree varchar_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1077 1066 1 btreesel btreenpage ));
 | 
			
		||||
@@ -317,7 +318,7 @@ DATA(insert OID = 0 (  403 1077 1069 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 1077 1068 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree date_ops
 | 
			
		||||
 *	nbtree date_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1114 1095 1 btreesel btreenpage ));
 | 
			
		||||
@@ -328,7 +329,7 @@ DATA(insert OID = 0 (  403 1114 1097 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree time_ops
 | 
			
		||||
 *	nbtree time_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1115 1110 1 btreesel btreenpage ));
 | 
			
		||||
@@ -338,7 +339,7 @@ DATA(insert OID = 0 (  403 1115 1113 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 1115 1112 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree datetime_ops
 | 
			
		||||
 *	nbtree datetime_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1312 1322 1 btreesel btreenpage ));
 | 
			
		||||
@@ -348,7 +349,7 @@ DATA(insert OID = 0 (  403 1312 1325 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  403 1312 1324 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nbtree timespan_ops
 | 
			
		||||
 *	nbtree timespan_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  403 1313 1332 1 btreesel btreenpage ));
 | 
			
		||||
@@ -361,17 +362,17 @@ BKI_BEGIN
 | 
			
		||||
#ifdef NOBTREE
 | 
			
		||||
BKI_END
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree int2_ops
 | 
			
		||||
 *	nobtree int2_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 421  95 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421	95 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421 522 2 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421  94 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421	94 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421 524 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 421 520 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree float8_ops
 | 
			
		||||
 *	nobtree float8_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 423 672 1 btreesel btreenpage ));
 | 
			
		||||
@@ -381,7 +382,7 @@ DATA(insert OID = 0 (  404 423 675 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 423 674 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree int24_ops
 | 
			
		||||
 *	nobtree int24_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 424 534 1 btreesel btreenpage ));
 | 
			
		||||
@@ -391,7 +392,7 @@ DATA(insert OID = 0 (  404 424 542 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 424 536 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree int42_ops
 | 
			
		||||
 *	nobtree int42_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 425 535 1 btreesel btreenpage ));
 | 
			
		||||
@@ -401,17 +402,17 @@ DATA(insert OID = 0 (  404 425 543 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 425 537 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree int4_ops
 | 
			
		||||
 *	nobtree int4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 426  97 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426	97 1 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426 523 2 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426  96 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426	96 3 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426 525 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 426 521 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree oid_ops
 | 
			
		||||
 *	nobtree oid_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 427 609 1 btreesel btreenpage ));
 | 
			
		||||
@@ -421,7 +422,7 @@ DATA(insert OID = 0 (  404 427 612 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 427 610 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree float4_ops
 | 
			
		||||
 *	nobtree float4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 428 622 1 btreesel btreenpage ));
 | 
			
		||||
@@ -431,7 +432,7 @@ DATA(insert OID = 0 (  404 428 625 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 428 623 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree char_ops
 | 
			
		||||
 *	nobtree char_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 429 631 1 btreesel btreenpage ));
 | 
			
		||||
@@ -441,7 +442,7 @@ DATA(insert OID = 0 (  404 429 634 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 429 633 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree char2_ops
 | 
			
		||||
 *	nobtree char2_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 406 418 1 btreesel btreenpage ));
 | 
			
		||||
@@ -451,7 +452,7 @@ DATA(insert OID = 0 (  404 406 463 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 406 460 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree char4_ops
 | 
			
		||||
 *	nobtree char4_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 407 419 1 btreesel btreenpage ));
 | 
			
		||||
@@ -461,7 +462,7 @@ DATA(insert OID = 0 (  404 407 464 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 407 461 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree char8_ops
 | 
			
		||||
 *	nobtree char8_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 408 420 1 btreesel btreenpage ));
 | 
			
		||||
@@ -471,7 +472,7 @@ DATA(insert OID = 0 (  404 408 465 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 408 462 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree char16_ops
 | 
			
		||||
 *	nobtree char16_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 430 645 1 btreesel btreenpage ));
 | 
			
		||||
@@ -481,7 +482,7 @@ DATA(insert OID = 0 (  404 430 648 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 430 647 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree name_ops
 | 
			
		||||
 *	nobtree name_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 1181 660 1 btreesel btreenpage ));
 | 
			
		||||
@@ -491,7 +492,7 @@ DATA(insert OID = 0 (  404 1181 663 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 1181 662 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree text_ops
 | 
			
		||||
 *	nobtree text_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 431 664 1 btreesel btreenpage ));
 | 
			
		||||
@@ -501,7 +502,7 @@ DATA(insert OID = 0 (  404 431 667 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 431 666 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree abstime_ops
 | 
			
		||||
 *	nobtree abstime_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 432 562 1 btreesel btreenpage ));
 | 
			
		||||
@@ -511,7 +512,7 @@ DATA(insert OID = 0 (  404 432 565 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 432 563 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree datetime_ops
 | 
			
		||||
 *	nobtree datetime_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 1312 1322 1 btreesel btreenpage ));
 | 
			
		||||
@@ -521,7 +522,7 @@ DATA(insert OID = 0 (  404 1312 1325 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 1312 1324 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  nobtree timespan_ops
 | 
			
		||||
 *	nobtree timespan_ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (  404 1313 1332 1 btreesel btreenpage ));
 | 
			
		||||
@@ -531,48 +532,48 @@ DATA(insert OID = 0 (  404 1313 1335 4 btreesel btreenpage ));
 | 
			
		||||
DATA(insert OID = 0 (  404 1313 1334 5 btreesel btreenpage ));
 | 
			
		||||
 | 
			
		||||
BKI_BEGIN
 | 
			
		||||
#endif /* NOBTREE */
 | 
			
		||||
#endif							/* NOBTREE */
 | 
			
		||||
BKI_END
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 *  hash table _ops
 | 
			
		||||
 *	hash table _ops
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/*  hash table int2_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 421  94 1 btreesel btreenpage ));
 | 
			
		||||
/*  hash table float8_ops */
 | 
			
		||||
/*	hash table int2_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 421	94 1 btreesel btreenpage ));
 | 
			
		||||
/*	hash table float8_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 423 670 1 btreesel btreenpage ));
 | 
			
		||||
/*  hash table int4_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 426  96 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table oid_ops */
 | 
			
		||||
/*	hash table int4_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 426	96 1 hashsel hashnpage ));
 | 
			
		||||
/*	hash table oid_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 427 607 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table float4_ops */
 | 
			
		||||
/*	hash table float4_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 428 620 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table char_ops */
 | 
			
		||||
/*	hash table char_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 429 92 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table char2_ops */
 | 
			
		||||
/*	hash table char2_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 406 412 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table char4_ops */
 | 
			
		||||
/*	hash table char4_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 407 413 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table char8_ops */
 | 
			
		||||
/*	hash table char8_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 408 414 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table char16_ops */
 | 
			
		||||
/*	hash table char16_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 430 1267 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table name_ops */
 | 
			
		||||
/*	hash table name_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1181 93 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table text_ops */
 | 
			
		||||
/*	hash table text_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 431 98 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table bpchar_ops */
 | 
			
		||||
/*	hash table bpchar_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1076 1054 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table varchar_ops */
 | 
			
		||||
/*	hash table varchar_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1077 1062 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table date_ops */
 | 
			
		||||
/*	hash table date_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1114 1093 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table time_ops */
 | 
			
		||||
/*	hash table time_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1115 1108 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table datetime_ops */
 | 
			
		||||
/*	hash table datetime_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1312 1320 1 hashsel hashnpage ));
 | 
			
		||||
/*  hash table timespan_ops */
 | 
			
		||||
/*	hash table timespan_ops */
 | 
			
		||||
DATA(insert OID = 0 (  405 1313 1330 1 hashsel hashnpage ));
 | 
			
		||||
 | 
			
		||||
#endif /* PG_AMOP_H */
 | 
			
		||||
#endif							/* PG_AMOP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,19 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_amproc.h--
 | 
			
		||||
 *    definition of the system "amproc" relation (pg_amproce)
 | 
			
		||||
 *    along with the relation's initial contents.  The amproc
 | 
			
		||||
 *    catalog is used to store procedures used by indexed access
 | 
			
		||||
 *    methods that aren't associated with operators.
 | 
			
		||||
 *	  definition of the system "amproc" relation (pg_amproce)
 | 
			
		||||
 *	  along with the relation's initial contents.  The amproc
 | 
			
		||||
 *	  catalog is used to store procedures used by indexed access
 | 
			
		||||
 *	  methods that aren't associated with operators.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_amproc.h,v 1.4 1997/09/04 18:43:57 thomas Exp $
 | 
			
		||||
 * $Id: pg_amproc.h,v 1.5 1997/09/07 04:56:39 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,43 +21,44 @@
 | 
			
		||||
#define PG_AMPROC_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_amproc definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_amproc
 | 
			
		||||
 *		pg_amproc definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_amproc
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_amproc) {
 | 
			
		||||
    Oid 	amid;
 | 
			
		||||
    Oid 	amopclaid;
 | 
			
		||||
    Oid 	amproc;
 | 
			
		||||
    int2 	amprocnum;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_amproc)
 | 
			
		||||
{
 | 
			
		||||
	Oid				amid;
 | 
			
		||||
	Oid				amopclaid;
 | 
			
		||||
	Oid				amproc;
 | 
			
		||||
	int2			amprocnum;
 | 
			
		||||
} FormData_pg_amproc;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_amproc corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_amproc relation.
 | 
			
		||||
 *		Form_pg_amproc corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_amproc relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_amproc	*Form_pg_amproc;
 | 
			
		||||
typedef FormData_pg_amproc *Form_pg_amproc;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_amproc
 | 
			
		||||
 *		compiler constants for pg_amproc
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_amproc			4
 | 
			
		||||
#define Anum_pg_amproc_amid		1
 | 
			
		||||
#define Anum_pg_amproc_amopclaid	2
 | 
			
		||||
#define Anum_pg_amproc_amproc		3
 | 
			
		||||
#define Anum_pg_amproc_amprocnum	4
 | 
			
		||||
#define Natts_pg_amproc					4
 | 
			
		||||
#define Anum_pg_amproc_amid				1
 | 
			
		||||
#define Anum_pg_amproc_amopclaid		2
 | 
			
		||||
#define Anum_pg_amproc_amproc			3
 | 
			
		||||
#define Anum_pg_amproc_amprocnum		4
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_amproc
 | 
			
		||||
 *		initial contents of pg_amproc
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -114,7 +115,7 @@ DATA(insert OID = 0 (404  430 1274 1));
 | 
			
		||||
DATA(insert OID = 0 (404  431  360 1));
 | 
			
		||||
DATA(insert OID = 0 (404  432  357 1));
 | 
			
		||||
BKI_BEGIN
 | 
			
		||||
#endif /* NOBTREE */
 | 
			
		||||
#endif							/* NOBTREE */
 | 
			
		||||
BKI_END
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 0 (405  421  449 1));
 | 
			
		||||
@@ -134,4 +135,4 @@ DATA(insert OID = 0 (405 1077 1081 1));
 | 
			
		||||
DATA(insert OID = 0 (405 1114  450 1));
 | 
			
		||||
DATA(insert OID = 0 (405 1115  694 1));
 | 
			
		||||
 | 
			
		||||
#endif /* PG_AMPROC_H */
 | 
			
		||||
#endif							/* PG_AMPROC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -15,40 +15,41 @@
 | 
			
		||||
#define PG_ATTRDEF_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_attrdef definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_attrdef
 | 
			
		||||
 *		pg_attrdef definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_attrdef
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_attrdef) BOOTSTRAP {
 | 
			
		||||
    Oid		adrelid;
 | 
			
		||||
    int2	adnum;
 | 
			
		||||
    text	adbin;
 | 
			
		||||
    text	adsrc;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_attrdef) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				adrelid;
 | 
			
		||||
	int2			adnum;
 | 
			
		||||
	text			adbin;
 | 
			
		||||
	text			adsrc;
 | 
			
		||||
} FormData_pg_attrdef;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_attrdef corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_attrdef relation.
 | 
			
		||||
 *		Form_pg_attrdef corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_attrdef relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_attrdef	*Form_pg_attrdef;
 | 
			
		||||
typedef FormData_pg_attrdef *Form_pg_attrdef;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_attrdef
 | 
			
		||||
 *		compiler constants for pg_attrdef
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_attrdef		4
 | 
			
		||||
#define Anum_pg_attrdef_adrelid		1
 | 
			
		||||
#define Anum_pg_attrdef_adnum		2
 | 
			
		||||
#define Anum_pg_attrdef_adbin		3
 | 
			
		||||
#define Anum_pg_attrdef_adsrc		4
 | 
			
		||||
#define Natts_pg_attrdef				4
 | 
			
		||||
#define Anum_pg_attrdef_adrelid			1
 | 
			
		||||
#define Anum_pg_attrdef_adnum			2
 | 
			
		||||
#define Anum_pg_attrdef_adbin			3
 | 
			
		||||
#define Anum_pg_attrdef_adsrc			4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_ATTRDEF_H */
 | 
			
		||||
#endif							/* PG_ATTRDEF_H */
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,22 +1,22 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_class.h--
 | 
			
		||||
 *    definition of the system "relation" relation (pg_class)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "relation" relation (pg_class)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_class.h,v 1.9 1997/09/04 13:25:13 vadim Exp $
 | 
			
		||||
 * $Id: pg_class.h,v 1.10 1997/09/07 04:56:42 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    ``pg_relation'' is being replaced by ``pg_class''.  currently
 | 
			
		||||
 *    we are only changing the name in the catalogs but someday the
 | 
			
		||||
 *    code will be changed too. -cim 2/26/90
 | 
			
		||||
 *    [it finally happens.  -ay 11/5/94]
 | 
			
		||||
 *	  ``pg_relation'' is being replaced by ``pg_class''.  currently
 | 
			
		||||
 *	  we are only changing the name in the catalogs but someday the
 | 
			
		||||
 *	  code will be changed too. -cim 2/26/90
 | 
			
		||||
 *	  [it finally happens.	-ay 11/5/94]
 | 
			
		||||
 *
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -24,149 +24,155 @@
 | 
			
		||||
#define PG_RELATION_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_class definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_class
 | 
			
		||||
 *		pg_class definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_class
 | 
			
		||||
 *
 | 
			
		||||
 *	Note: the #if 0, #endif around the BKI_BEGIN.. END block
 | 
			
		||||
 *	      below keeps cpp from seeing what is meant for the
 | 
			
		||||
 *	      genbki script: pg_relation is now called pg_class, but
 | 
			
		||||
 *	      only in the catalogs -cim 2/26/90
 | 
			
		||||
 *		Note: the #if 0, #endif around the BKI_BEGIN.. END block
 | 
			
		||||
 *			  below keeps cpp from seeing what is meant for the
 | 
			
		||||
 *			  genbki script: pg_relation is now called pg_class, but
 | 
			
		||||
 *			  only in the catalogs -cim 2/26/90
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	This structure is actually variable-length (the last attribute is
 | 
			
		||||
 *	a POSTGRES array).  Hence, sizeof(FormData_pg_class) does not
 | 
			
		||||
 *	describe the fixed-length or actual size of the structure.
 | 
			
		||||
 *	FormData_pg_class.relacl may not be correctly aligned, either,
 | 
			
		||||
 *	if aclitem and struct varlena don't align together.  Hence,
 | 
			
		||||
 *	you MUST use heap_getattr() to get the relacl field.
 | 
			
		||||
 *		This structure is actually variable-length (the last attribute is
 | 
			
		||||
 *		a POSTGRES array).	Hence, sizeof(FormData_pg_class) does not
 | 
			
		||||
 *		describe the fixed-length or actual size of the structure.
 | 
			
		||||
 *		FormData_pg_class.relacl may not be correctly aligned, either,
 | 
			
		||||
 *		if aclitem and struct varlena don't align together.  Hence,
 | 
			
		||||
 *		you MUST use heap_getattr() to get the relacl field.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_class) BOOTSTRAP {
 | 
			
		||||
     NameData 	relname;
 | 
			
		||||
     Oid        reltype;          
 | 
			
		||||
     Oid 	relowner;
 | 
			
		||||
     Oid 	relam;
 | 
			
		||||
     int4 	relpages;
 | 
			
		||||
     int4 	reltuples;
 | 
			
		||||
     int4 	relexpires; /* really used as a abstime, but fudge it for now*/
 | 
			
		||||
     int4	relpreserved;/*really used as a reltime, but fudge it for now*/
 | 
			
		||||
     bool 	relhasindex;
 | 
			
		||||
     bool 	relisshared;
 | 
			
		||||
     char 	relkind;
 | 
			
		||||
     char 	relarch; /* 'h' = heavy, 'l' = light, 'n' = no archival*/
 | 
			
		||||
     int2 	relnatts;
 | 
			
		||||
       /* relnatts is the number of user attributes this class has.  There 
 | 
			
		||||
          must be exactly this many instances in Class pg_attribute for this 
 | 
			
		||||
          class which have attnum > 0 (= user attribute).
 | 
			
		||||
          */
 | 
			
		||||
     int2	relsmgr;
 | 
			
		||||
     int2	relchecks;		/* # of CHECK constraints */
 | 
			
		||||
     int2	reltriggers;		/* # of TRIGGERs */
 | 
			
		||||
     bool	relhasrules;
 | 
			
		||||
     aclitem	relacl[1];		/* this is here for the catalog */
 | 
			
		||||
CATALOG(pg_class) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		relname;
 | 
			
		||||
	Oid				reltype;
 | 
			
		||||
	Oid				relowner;
 | 
			
		||||
	Oid				relam;
 | 
			
		||||
	int4			relpages;
 | 
			
		||||
	int4			reltuples;
 | 
			
		||||
	int4			relexpires; /* really used as a abstime, but fudge it
 | 
			
		||||
								 * for now */
 | 
			
		||||
	int4			relpreserved;		/* really used as a reltime, but
 | 
			
		||||
										 * fudge it for now */
 | 
			
		||||
	bool			relhasindex;
 | 
			
		||||
	bool			relisshared;
 | 
			
		||||
	char			relkind;
 | 
			
		||||
	char			relarch;	/* 'h' = heavy, 'l' = light, 'n' = no
 | 
			
		||||
								 * archival */
 | 
			
		||||
	int2			relnatts;
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
	 * relnatts is the number of user attributes this class has.  There
 | 
			
		||||
	 * must be exactly this many instances in Class pg_attribute for this
 | 
			
		||||
	 * class which have attnum > 0 (= user attribute).
 | 
			
		||||
	 */
 | 
			
		||||
	int2			relsmgr;
 | 
			
		||||
	int2			relchecks;	/* # of CHECK constraints */
 | 
			
		||||
	int2			reltriggers;/* # of TRIGGERs */
 | 
			
		||||
	bool			relhasrules;
 | 
			
		||||
	aclitem			relacl[1];	/* this is here for the catalog */
 | 
			
		||||
} FormData_pg_class;
 | 
			
		||||
 | 
			
		||||
#define CLASS_TUPLE_SIZE \
 | 
			
		||||
     (offsetof(FormData_pg_class,relhasrules) + sizeof(bool))
 | 
			
		||||
	 (offsetof(FormData_pg_class,relhasrules) + sizeof(bool))
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_class corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_class relation.
 | 
			
		||||
 *		Form_pg_class corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_class relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_class	*Form_pg_class;
 | 
			
		||||
typedef FormData_pg_class *Form_pg_class;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_class
 | 
			
		||||
 *		compiler constants for pg_class
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Natts_pg_class_fixed is used to tell routines that insert new
 | 
			
		||||
 *	pg_class tuples (as opposed to replacing old ones) that there's no
 | 
			
		||||
 *	relacl field.
 | 
			
		||||
 *		Natts_pg_class_fixed is used to tell routines that insert new
 | 
			
		||||
 *		pg_class tuples (as opposed to replacing old ones) that there's no
 | 
			
		||||
 *		relacl field.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_class_fixed		17
 | 
			
		||||
#define Natts_pg_class			18
 | 
			
		||||
#define Anum_pg_class_relname		1
 | 
			
		||||
#define Anum_pg_class_reltype           2
 | 
			
		||||
#define Anum_pg_class_relowner		3
 | 
			
		||||
#define Anum_pg_class_relam		4
 | 
			
		||||
#define Anum_pg_class_relpages		5
 | 
			
		||||
#define Anum_pg_class_reltuples		6
 | 
			
		||||
#define Anum_pg_class_relexpires	7
 | 
			
		||||
#define Anum_pg_class_relpreserved	8
 | 
			
		||||
#define Anum_pg_class_relhasindex	9
 | 
			
		||||
#define Anum_pg_class_relisshared	10
 | 
			
		||||
#define Anum_pg_class_relkind		11
 | 
			
		||||
#define Anum_pg_class_relarch		12
 | 
			
		||||
#define Anum_pg_class_relnatts		13
 | 
			
		||||
#define Anum_pg_class_relsmgr		14
 | 
			
		||||
#define Anum_pg_class_relchecks		15
 | 
			
		||||
#define Anum_pg_class_reltriggers	16
 | 
			
		||||
#define Anum_pg_class_relhasrules	17
 | 
			
		||||
#define Anum_pg_class_relacl		18
 | 
			
		||||
#define Natts_pg_class_fixed			17
 | 
			
		||||
#define Natts_pg_class					18
 | 
			
		||||
#define Anum_pg_class_relname			1
 | 
			
		||||
#define Anum_pg_class_reltype			2
 | 
			
		||||
#define Anum_pg_class_relowner			3
 | 
			
		||||
#define Anum_pg_class_relam				4
 | 
			
		||||
#define Anum_pg_class_relpages			5
 | 
			
		||||
#define Anum_pg_class_reltuples			6
 | 
			
		||||
#define Anum_pg_class_relexpires		7
 | 
			
		||||
#define Anum_pg_class_relpreserved		8
 | 
			
		||||
#define Anum_pg_class_relhasindex		9
 | 
			
		||||
#define Anum_pg_class_relisshared		10
 | 
			
		||||
#define Anum_pg_class_relkind			11
 | 
			
		||||
#define Anum_pg_class_relarch			12
 | 
			
		||||
#define Anum_pg_class_relnatts			13
 | 
			
		||||
#define Anum_pg_class_relsmgr			14
 | 
			
		||||
#define Anum_pg_class_relchecks			15
 | 
			
		||||
#define Anum_pg_class_reltriggers		16
 | 
			
		||||
#define Anum_pg_class_relhasrules		17
 | 
			
		||||
#define Anum_pg_class_relacl			18
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_class
 | 
			
		||||
 *		initial contents of pg_class
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 1247 (  pg_type 71          PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1249 (  pg_attribute 75     PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1251 (  pg_demon 76         PGUID 0 0 0 0 0 f t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1253 (  pg_magic 80         PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1255 (  pg_proc 81          PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1257 (  pg_server 82        PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1259 (  pg_class 83         PGUID 0 0 0 0 0 f f r n 18 0 0 0 f _null_ ));    
 | 
			
		||||
DATA(insert OID = 1260 (  pg_user 86          PGUID 0 0 0 0 0 f t r n 6 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1261 (  pg_group 87         PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1262 (  pg_database 88      PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1263 (  pg_defaults 89      PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1264 (  pg_variable 90      PGUID 0 0 0 0 0 f t s n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1269 (  pg_log  99          PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1271 (  pg_time 100         PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1273 (  pg_hosts 101        PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1215 (  pg_attrdef 109      PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1216 (  pg_relcheck 110     PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1219 (  pg_trigger 111      PGUID 0 0 0 0 0 t t r n 7 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1247 (  pg_type 71		  PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1249 (  pg_attribute 75	  PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1251 (  pg_demon 76		  PGUID 0 0 0 0 0 f t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1253 (  pg_magic 80		  PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1255 (  pg_proc 81		  PGUID 0 0 0 0 0 f f r n 16 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1257 (  pg_server 82		  PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1259 (  pg_class 83		  PGUID 0 0 0 0 0 f f r n 18 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1260 (  pg_user 86		  PGUID 0 0 0 0 0 f t r n 6 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1261 (  pg_group 87		  PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1262 (  pg_database 88	  PGUID 0 0 0 0 0 f t r n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1263 (  pg_defaults 89	  PGUID 0 0 0 0 0 f t r n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1264 (  pg_variable 90	  PGUID 0 0 0 0 0 f t s n 2 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1269 (  pg_log  99		  PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1271 (  pg_time 100		  PGUID 0 0 0 0 0 f t s n 1 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1273 (  pg_hosts 101		  PGUID 0 0 0 0 0 f t s n 3 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1215 (  pg_attrdef 109	  PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1216 (  pg_relcheck 110	  PGUID 0 0 0 0 0 t t r n 4 0 0 0 f _null_ ));
 | 
			
		||||
DATA(insert OID = 1219 (  pg_trigger 111	  PGUID 0 0 0 0 0 t t r n 7 0 0 0 f _null_ ));
 | 
			
		||||
 | 
			
		||||
#define RelOid_pg_type		1247
 | 
			
		||||
#define RelOid_pg_demon       	1251
 | 
			
		||||
#define RelOid_pg_attribute  	1249   
 | 
			
		||||
#define RelOid_pg_magic   	1253      
 | 
			
		||||
#define RelOid_pg_proc       	1255
 | 
			
		||||
#define RelOid_pg_server     	1257   
 | 
			
		||||
#define RelOid_pg_class   	1259   
 | 
			
		||||
#define RelOid_pg_user       	1260   
 | 
			
		||||
#define RelOid_pg_group       	1261
 | 
			
		||||
#define RelOid_pg_database    	1262   
 | 
			
		||||
#define RelOid_pg_defaults  	1263    
 | 
			
		||||
#define RelOid_pg_variable   	1264   
 | 
			
		||||
#define RelOid_pg_log   	1269
 | 
			
		||||
#define RelOid_pg_time   	1271      
 | 
			
		||||
#define RelOid_pg_hosts   	1273      
 | 
			
		||||
#define RelOid_pg_attrdef  	1215    
 | 
			
		||||
#define RelOid_pg_relcheck  	1216    
 | 
			
		||||
#define RelOid_pg_trigger  	1219    
 | 
			
		||||
    
 | 
			
		||||
#define MAX_SYSTEM_RELOID       1273    /* this does not seem to be used */
 | 
			
		||||
                                        /* anywhere                      */
 | 
			
		||||
#define RelOid_pg_type			1247
 | 
			
		||||
#define RelOid_pg_demon			1251
 | 
			
		||||
#define RelOid_pg_attribute		1249
 | 
			
		||||
#define RelOid_pg_magic			1253
 | 
			
		||||
#define RelOid_pg_proc			1255
 | 
			
		||||
#define RelOid_pg_server		1257
 | 
			
		||||
#define RelOid_pg_class			1259
 | 
			
		||||
#define RelOid_pg_user			1260
 | 
			
		||||
#define RelOid_pg_group			1261
 | 
			
		||||
#define RelOid_pg_database		1262
 | 
			
		||||
#define RelOid_pg_defaults		1263
 | 
			
		||||
#define RelOid_pg_variable		1264
 | 
			
		||||
#define RelOid_pg_log			1269
 | 
			
		||||
#define RelOid_pg_time			1271
 | 
			
		||||
#define RelOid_pg_hosts			1273
 | 
			
		||||
#define RelOid_pg_attrdef		1215
 | 
			
		||||
#define RelOid_pg_relcheck		1216
 | 
			
		||||
#define RelOid_pg_trigger		1219
 | 
			
		||||
 | 
			
		||||
#define       RELKIND_INDEX           'i'     /* secondary index */
 | 
			
		||||
#define       RELKIND_RELATION        'r'     /* cataloged heap */
 | 
			
		||||
#define       RELKIND_SPECIAL         's'     /* special (non-heap) */
 | 
			
		||||
#define       RELKIND_SEQUENCE        'S'     /* SEQUENCE relation */
 | 
			
		||||
#define       RELKIND_UNCATALOGED     'u'     /* temporary heap */
 | 
			
		||||
#define MAX_SYSTEM_RELOID		1273	/* this does not seem to be used */
 | 
			
		||||
 /* anywhere					  */
 | 
			
		||||
 | 
			
		||||
#endif /* PG_RELATION_H */
 | 
			
		||||
#define		  RELKIND_INDEX			  'i'		/* secondary index */
 | 
			
		||||
#define		  RELKIND_RELATION		  'r'		/* cataloged heap */
 | 
			
		||||
#define		  RELKIND_SPECIAL		  's'		/* special (non-heap) */
 | 
			
		||||
#define		  RELKIND_SEQUENCE		  'S'		/* SEQUENCE relation */
 | 
			
		||||
#define		  RELKIND_UNCATALOGED	  'u'		/* temporary heap */
 | 
			
		||||
 | 
			
		||||
#endif							/* PG_RELATION_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_database.h--
 | 
			
		||||
 *    definition of the system "database" relation (pg_database)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "database" relation (pg_database)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_database.h,v 1.3 1997/08/21 02:28:55 momjian Exp $
 | 
			
		||||
 * $Id: pg_database.h,v 1.4 1997/09/07 04:56:43 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,38 +19,39 @@
 | 
			
		||||
#define PG_DATABASE_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_database definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_database
 | 
			
		||||
 *		pg_database definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_database
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_database) BOOTSTRAP {
 | 
			
		||||
    NameData 	datname;
 | 
			
		||||
    int4 	datdba;
 | 
			
		||||
    text 	datpath;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_database) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		datname;
 | 
			
		||||
	int4			datdba;
 | 
			
		||||
	text			datpath;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
} FormData_pg_database;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_database corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_database relation.
 | 
			
		||||
 *		Form_pg_database corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_database relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_database	*Form_pg_database;
 | 
			
		||||
typedef FormData_pg_database *Form_pg_database;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_database
 | 
			
		||||
 *		compiler constants for pg_database
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_database		3
 | 
			
		||||
#define Anum_pg_database_datname	1
 | 
			
		||||
#define Anum_pg_database_datdba		2
 | 
			
		||||
#define Anum_pg_database_datpath	3
 | 
			
		||||
#define Natts_pg_database				3
 | 
			
		||||
#define Anum_pg_database_datname		1
 | 
			
		||||
#define Anum_pg_database_datdba			2
 | 
			
		||||
#define Anum_pg_database_datpath		3
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_DATABASE_H */
 | 
			
		||||
#endif							/* PG_DATABASE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_defaults.h--
 | 
			
		||||
 *   definition of the system "defaults" relation (pg_defaults)
 | 
			
		||||
 *   along with the relation's initial contents.
 | 
			
		||||
 *	 definition of the system "defaults" relation (pg_defaults)
 | 
			
		||||
 *	 along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_defaults.h,v 1.2 1996/10/31 09:47:24 scrappy Exp $
 | 
			
		||||
 * $Id: pg_defaults.h,v 1.3 1997/09/07 04:56:44 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,36 +19,37 @@
 | 
			
		||||
#define PG_DEFAULTS_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_defaults definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_defaults
 | 
			
		||||
 *		pg_defaults definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_defaults
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_defaults) BOOTSTRAP {
 | 
			
		||||
    NameData 	defname;
 | 
			
		||||
    NameData 	defvalue;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_defaults) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		defname;
 | 
			
		||||
	NameData		defvalue;
 | 
			
		||||
} FormData_pg_defaults;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_defaults corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_defaults relation.
 | 
			
		||||
 *		Form_pg_defaults corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_defaults relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_defaults	*Form_pg_defaults;
 | 
			
		||||
typedef FormData_pg_defaults *Form_pg_defaults;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_defaults
 | 
			
		||||
 *		compiler constants for pg_defaults
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_defaults		2
 | 
			
		||||
#define Anum_pg_defaults_defname	1
 | 
			
		||||
#define Anum_pg_defaults_defvalue	2
 | 
			
		||||
#define Natts_pg_defaults				2
 | 
			
		||||
#define Anum_pg_defaults_defname		1
 | 
			
		||||
#define Anum_pg_defaults_defvalue		2
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_DEFAULTS_H */
 | 
			
		||||
#endif							/* PG_DEFAULTS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,57 +1,58 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_demon.h--
 | 
			
		||||
 *   definition of the system "demon" relation (pg_demon)
 | 
			
		||||
 *   along with the relation's initial contents.
 | 
			
		||||
 *	 definition of the system "demon" relation (pg_demon)
 | 
			
		||||
 *	 along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_demon.h,v 1.2 1996/10/31 09:47:26 scrappy Exp $
 | 
			
		||||
 * $Id: pg_demon.h,v 1.3 1997/09/07 04:56:45 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef PG_DEMON_H	
 | 
			
		||||
#define PG_DEMON_H	
 | 
			
		||||
#ifndef PG_DEMON_H
 | 
			
		||||
#define PG_DEMON_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_demon definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_demon
 | 
			
		||||
 *		pg_demon definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_demon
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_demon) BOOTSTRAP {
 | 
			
		||||
    Oid 	demserid;
 | 
			
		||||
    NameData 	demname;
 | 
			
		||||
    Oid 	demowner;
 | 
			
		||||
    regproc 	demcode;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_demon) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				demserid;
 | 
			
		||||
	NameData		demname;
 | 
			
		||||
	Oid				demowner;
 | 
			
		||||
	regproc			demcode;
 | 
			
		||||
} FormData_pg_demon;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_demon corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_demon relation.
 | 
			
		||||
 *		Form_pg_demon corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_demon relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_demon	*Form_pg_demon;
 | 
			
		||||
typedef FormData_pg_demon *Form_pg_demon;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_demon
 | 
			
		||||
 *		compiler constants for pg_demon
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_demon			4
 | 
			
		||||
#define Anum_pg_demon_demserid		1
 | 
			
		||||
#define Anum_pg_demon_demname		2
 | 
			
		||||
#define Anum_pg_demon_demowner		3
 | 
			
		||||
#define Anum_pg_demon_demcode		4
 | 
			
		||||
#define Natts_pg_demon					4
 | 
			
		||||
#define Anum_pg_demon_demserid			1
 | 
			
		||||
#define Anum_pg_demon_demname			2
 | 
			
		||||
#define Anum_pg_demon_demowner			3
 | 
			
		||||
#define Anum_pg_demon_demcode			4
 | 
			
		||||
 | 
			
		||||
#endif /* PG_DEMON_H */
 | 
			
		||||
#endif							/* PG_DEMON_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_group.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_group.h,v 1.2 1996/10/31 09:47:28 scrappy Exp $
 | 
			
		||||
 * $Id: pg_group.h,v 1.3 1997/09/07 04:56:46 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -18,24 +18,26 @@
 | 
			
		||||
#define PG_GROUP_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.
 | 
			
		||||
 *		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_group) BOOTSTRAP {
 | 
			
		||||
        NameData groname;
 | 
			
		||||
        int4    grosysid;
 | 
			
		||||
	int4	grolist[1];
 | 
			
		||||
CATALOG(pg_group) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		groname;
 | 
			
		||||
	int4			grosysid;
 | 
			
		||||
	int4			grolist[1];
 | 
			
		||||
} FormData_pg_group;
 | 
			
		||||
 | 
			
		||||
/* VARIABLE LENGTH STRUCTURE */
 | 
			
		||||
 | 
			
		||||
typedef FormData_pg_group	*Form_pg_group;
 | 
			
		||||
typedef FormData_pg_group *Form_pg_group;
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_group		1
 | 
			
		||||
#define Natts_pg_group			1
 | 
			
		||||
#define Anum_pg_group_groname	1
 | 
			
		||||
#define Anum_pg_group_grosysid	2
 | 
			
		||||
#define Anum_pg_group_grolist	3
 | 
			
		||||
 | 
			
		||||
#endif /* PG_GROUP_H */
 | 
			
		||||
#endif							/* PG_GROUP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -2,19 +2,19 @@
 | 
			
		||||
 *
 | 
			
		||||
 * pg_hosts.h--
 | 
			
		||||
 *
 | 
			
		||||
 *     the pg_hosts system catalog provides host-based access to the 
 | 
			
		||||
 * backend.  Only those hosts that are in the pg_hosts 
 | 
			
		||||
 *	   the pg_hosts system catalog provides host-based access to the
 | 
			
		||||
 * backend.  Only those hosts that are in the pg_hosts
 | 
			
		||||
 *
 | 
			
		||||
 *  currently, this table is not used, instead file-based host authentication
 | 
			
		||||
 *	currently, this table is not used, instead file-based host authentication
 | 
			
		||||
 * is used
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_hosts.h,v 1.2 1996/10/31 09:47:30 scrappy Exp $
 | 
			
		||||
 * $Id: pg_hosts.h,v 1.3 1997/09/07 04:56:46 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -22,22 +22,24 @@
 | 
			
		||||
#define PG_HOSTS_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.
 | 
			
		||||
 *		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_hosts) BOOTSTRAP {
 | 
			
		||||
        NameData dbName;   
 | 
			
		||||
	text	address; 
 | 
			
		||||
	text    mask;
 | 
			
		||||
CATALOG(pg_hosts) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		dbName;
 | 
			
		||||
	text			address;
 | 
			
		||||
	text			mask;
 | 
			
		||||
} FormData_pg_hosts;
 | 
			
		||||
 | 
			
		||||
typedef FormData_pg_hosts	*Form_pg_hosts;
 | 
			
		||||
#define Natts_pg_hosts		3
 | 
			
		||||
typedef FormData_pg_hosts *Form_pg_hosts;
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_hosts			3
 | 
			
		||||
#define Anum_pg_hosts_dbName	1
 | 
			
		||||
#define Anum_pg_hosts_address	2
 | 
			
		||||
#define Anum_pg_hosts_mask      3
 | 
			
		||||
#define Anum_pg_hosts_mask		3
 | 
			
		||||
 | 
			
		||||
#endif /* PG_HOSTS_H */
 | 
			
		||||
#endif							/* PG_HOSTS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_index.h--
 | 
			
		||||
 *    definition of the system "index" relation (pg_index)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "index" relation (pg_index)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_index.h,v 1.3 1996/11/13 20:50:57 scrappy Exp $
 | 
			
		||||
 * $Id: pg_index.h,v 1.4 1997/09/07 04:56:47 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,64 +19,69 @@
 | 
			
		||||
#define PG_INDEX_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_index definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_index.  The oid of the index relation
 | 
			
		||||
 *	is stored in indexrelid; the oid of the indexed relation is stored
 | 
			
		||||
 *	in indrelid.
 | 
			
		||||
 *		pg_index definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_index.  The oid of the index relation
 | 
			
		||||
 *		is stored in indexrelid; the oid of the indexed relation is stored
 | 
			
		||||
 *		in indrelid.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
 * it seems that all variable length fields should go at the _end_,
 | 
			
		||||
 * because the system cache routines only copy the fields up to the
 | 
			
		||||
 * first variable length field.  so I moved indislossy, indhaskeytype,
 | 
			
		||||
 * and indisunique before indpred.  --djm 8/20/96
 | 
			
		||||
 * and indisunique before indpred.	--djm 8/20/96
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_index) {
 | 
			
		||||
    Oid 	indexrelid;
 | 
			
		||||
    Oid 	indrelid;
 | 
			
		||||
    Oid		indproc; /* registered procedure for functional index */
 | 
			
		||||
    int28 	indkey;
 | 
			
		||||
    oid8 	indclass;
 | 
			
		||||
    bool 	indisclustered;
 | 
			
		||||
    bool 	indisarchived;
 | 
			
		||||
    bool	indislossy; /* do we fetch false tuples (lossy compression)? */
 | 
			
		||||
    bool	indhaskeytype; /* does key type != attribute type? */
 | 
			
		||||
    bool        indisunique; /* is this a unique index? */
 | 
			
		||||
    text	indpred;	/* query plan for partial index predicate */
 | 
			
		||||
CATALOG(pg_index)
 | 
			
		||||
{
 | 
			
		||||
	Oid				indexrelid;
 | 
			
		||||
	Oid				indrelid;
 | 
			
		||||
	Oid				indproc;	/* registered procedure for functional
 | 
			
		||||
								 * index */
 | 
			
		||||
	int28			indkey;
 | 
			
		||||
	oid8			indclass;
 | 
			
		||||
	bool			indisclustered;
 | 
			
		||||
	bool			indisarchived;
 | 
			
		||||
	bool			indislossy; /* do we fetch false tuples (lossy
 | 
			
		||||
								 * compression)? */
 | 
			
		||||
	bool			indhaskeytype;		/* does key type != attribute
 | 
			
		||||
										 * type? */
 | 
			
		||||
	bool			indisunique;/* is this a unique index? */
 | 
			
		||||
	text			indpred;	/* query plan for partial index predicate */
 | 
			
		||||
} FormData_pg_index;
 | 
			
		||||
 | 
			
		||||
#define INDEX_MAX_KEYS 8  /* maximum number of keys in an index definition */
 | 
			
		||||
#define INDEX_MAX_KEYS 8		/* maximum number of keys in an index
 | 
			
		||||
								 * definition */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_index corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_index relation.
 | 
			
		||||
 *		Form_pg_index corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_index relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_index	*IndexTupleForm;
 | 
			
		||||
typedef FormData_pg_index *IndexTupleForm;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_index
 | 
			
		||||
 *		compiler constants for pg_index
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_index			11
 | 
			
		||||
#define Anum_pg_index_indexrelid	1
 | 
			
		||||
#define Anum_pg_index_indrelid		2
 | 
			
		||||
#define Anum_pg_index_indproc		3
 | 
			
		||||
#define Anum_pg_index_indkey		4
 | 
			
		||||
#define Anum_pg_index_indclass		5
 | 
			
		||||
#define Natts_pg_index					11
 | 
			
		||||
#define Anum_pg_index_indexrelid		1
 | 
			
		||||
#define Anum_pg_index_indrelid			2
 | 
			
		||||
#define Anum_pg_index_indproc			3
 | 
			
		||||
#define Anum_pg_index_indkey			4
 | 
			
		||||
#define Anum_pg_index_indclass			5
 | 
			
		||||
#define Anum_pg_index_indisclustered	6
 | 
			
		||||
#define Anum_pg_index_indisarchived	7
 | 
			
		||||
#define Anum_pg_index_indislossy	8
 | 
			
		||||
#define Anum_pg_index_indhaskeytype	9
 | 
			
		||||
#define Anum_pg_index_indisunique       10
 | 
			
		||||
#define Anum_pg_index_indpred		11
 | 
			
		||||
#define Anum_pg_index_indisarchived		7
 | 
			
		||||
#define Anum_pg_index_indislossy		8
 | 
			
		||||
#define Anum_pg_index_indhaskeytype		9
 | 
			
		||||
#define Anum_pg_index_indisunique		10
 | 
			
		||||
#define Anum_pg_index_indpred			11
 | 
			
		||||
 | 
			
		||||
#endif /* PG_INDEX_H */
 | 
			
		||||
#endif							/* PG_INDEX_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_inheritproc.h--
 | 
			
		||||
 *    definition of the system "inheritproc" relation (pg_inheritproc)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "inheritproc" relation (pg_inheritproc)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_inheritproc.h,v 1.2 1996/10/31 09:47:33 scrappy Exp $
 | 
			
		||||
 * $Id: pg_inheritproc.h,v 1.3 1997/09/07 04:56:50 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,40 +19,41 @@
 | 
			
		||||
#define PG_INHERITPROC_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_inheritproc definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_inheritproc
 | 
			
		||||
 *		pg_inheritproc definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_inheritproc
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_inheritproc) {
 | 
			
		||||
     NameData 	inhproname;
 | 
			
		||||
     Oid 	inhargrel;
 | 
			
		||||
     Oid 	inhdefrel;
 | 
			
		||||
     Oid 	inhproc;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_inheritproc)
 | 
			
		||||
{
 | 
			
		||||
	NameData		inhproname;
 | 
			
		||||
	Oid				inhargrel;
 | 
			
		||||
	Oid				inhdefrel;
 | 
			
		||||
	Oid				inhproc;
 | 
			
		||||
} FormData_pg_inheritproc;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_inheritproc corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_inheritproc relation.
 | 
			
		||||
 *		Form_pg_inheritproc corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_inheritproc relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_inheritproc	*Form_pg_inheritproc;
 | 
			
		||||
typedef FormData_pg_inheritproc *Form_pg_inheritproc;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_inheritproc
 | 
			
		||||
 *		compiler constants for pg_inheritproc
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_inheritproc		4
 | 
			
		||||
#define Natts_pg_inheritproc			4
 | 
			
		||||
#define Anum_pg_inheritproc_inhproname	1
 | 
			
		||||
#define Anum_pg_inheritproc_inhargrel	2
 | 
			
		||||
#define Anum_pg_inheritproc_inhdefrel	3
 | 
			
		||||
#define Anum_pg_inheritproc_inhproc	4
 | 
			
		||||
#define Anum_pg_inheritproc_inhproc		4
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_INHERITPROC_H */
 | 
			
		||||
#endif							/* PG_INHERITPROC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_inherits.h--
 | 
			
		||||
 *    definition of the system "inherits" relation (pg_inherits)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "inherits" relation (pg_inherits)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_inherits.h,v 1.2 1996/10/31 09:47:35 scrappy Exp $
 | 
			
		||||
 * $Id: pg_inherits.h,v 1.3 1997/09/07 04:56:51 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,38 +19,39 @@
 | 
			
		||||
#define PG_INHERITS_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_inherits definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_inherits
 | 
			
		||||
 *		pg_inherits definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_inherits
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_inherits) {
 | 
			
		||||
    Oid 	inhrel;
 | 
			
		||||
    Oid 	inhparent;
 | 
			
		||||
    int4 	inhseqno;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_inherits)
 | 
			
		||||
{
 | 
			
		||||
	Oid				inhrel;
 | 
			
		||||
	Oid				inhparent;
 | 
			
		||||
	int4			inhseqno;
 | 
			
		||||
} FormData_pg_inherits;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_inherits corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_inherits relation.
 | 
			
		||||
 *		Form_pg_inherits corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_inherits relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_inherits	*InheritsTupleForm;
 | 
			
		||||
typedef FormData_pg_inherits *InheritsTupleForm;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_inherits
 | 
			
		||||
 *		compiler constants for pg_inherits
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_inherits		3
 | 
			
		||||
#define Anum_pg_inherits_inhrel		1
 | 
			
		||||
#define Anum_pg_inherits_inhparent	2
 | 
			
		||||
#define Anum_pg_inherits_inhseqno	3
 | 
			
		||||
#define Natts_pg_inherits				3
 | 
			
		||||
#define Anum_pg_inherits_inhrel			1
 | 
			
		||||
#define Anum_pg_inherits_inhparent		2
 | 
			
		||||
#define Anum_pg_inherits_inhseqno		3
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_INHERITS_H */
 | 
			
		||||
#endif							/* PG_INHERITS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_ipl.h--
 | 
			
		||||
 *    definition of the system "ipl" relation (pg_ipl)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "ipl" relation (pg_ipl)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_ipl.h,v 1.2 1996/10/31 09:47:36 scrappy Exp $
 | 
			
		||||
 * $Id: pg_ipl.h,v 1.3 1997/09/07 04:56:52 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,38 +19,39 @@
 | 
			
		||||
#define PG_IPL_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_ipl definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_ipl
 | 
			
		||||
 *		pg_ipl definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_ipl
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_ipl) {
 | 
			
		||||
     Oid 	iplrel;
 | 
			
		||||
     Oid 	iplipl;
 | 
			
		||||
     int4 	iplseqno;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_ipl)
 | 
			
		||||
{
 | 
			
		||||
	Oid				iplrel;
 | 
			
		||||
	Oid				iplipl;
 | 
			
		||||
	int4			iplseqno;
 | 
			
		||||
} FormData_pg_ipl;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_ipl corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_ipl relation.
 | 
			
		||||
 *		Form_pg_ipl corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_ipl relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_ipl	*Form_pg_ipl;
 | 
			
		||||
typedef FormData_pg_ipl *Form_pg_ipl;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_ipl
 | 
			
		||||
 *		compiler constants for pg_ipl
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_ipl		3
 | 
			
		||||
#define Anum_pg_ipl_iplrel	1
 | 
			
		||||
#define Anum_pg_ipl_iplipl	2
 | 
			
		||||
#define Natts_pg_ipl			3
 | 
			
		||||
#define Anum_pg_ipl_iplrel		1
 | 
			
		||||
#define Anum_pg_ipl_iplipl		2
 | 
			
		||||
#define Anum_pg_ipl_iplseqno	3
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_IPL_H */
 | 
			
		||||
#endif							/* PG_IPL_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_language.h--
 | 
			
		||||
 *    definition of the system "language" relation (pg_language)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "language" relation (pg_language)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_language.h,v 1.2 1996/10/31 09:47:38 scrappy Exp $
 | 
			
		||||
 * $Id: pg_language.h,v 1.3 1997/09/07 04:56:53 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,39 +19,40 @@
 | 
			
		||||
#define PG_LANGUAGE_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_language definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_language
 | 
			
		||||
 *		pg_language definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_language
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_language) {
 | 
			
		||||
    NameData 	lanname;
 | 
			
		||||
    text 	lancompiler;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_language)
 | 
			
		||||
{
 | 
			
		||||
	NameData		lanname;
 | 
			
		||||
	text			lancompiler;/* VARIABLE LENGTH FIELD */
 | 
			
		||||
} FormData_pg_language;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_language corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_language relation.
 | 
			
		||||
 *		Form_pg_language corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_language relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_language	*Form_pg_language;
 | 
			
		||||
typedef FormData_pg_language *Form_pg_language;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_language
 | 
			
		||||
 *		compiler constants for pg_language
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_language		2
 | 
			
		||||
#define Anum_pg_language_lanname	1
 | 
			
		||||
#define Natts_pg_language				2
 | 
			
		||||
#define Anum_pg_language_lanname		1
 | 
			
		||||
#define Anum_pg_language_lancompiler	2
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_language
 | 
			
		||||
 *		initial contents of pg_language
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -63,12 +64,5 @@ DATA(insert OID = 13 ( "C" "/bin/cc" ));
 | 
			
		||||
DATA(insert OID = 14 ( "sql" "postgres"));
 | 
			
		||||
#define SQLlanguageId 14
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
#endif /* PG_LANGUAGE_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif							/* PG_LANGUAGE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_listener.h--
 | 
			
		||||
 *    Asynchronous notification
 | 
			
		||||
 *	  Asynchronous notification
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_listener.h,v 1.2 1996/10/31 09:47:40 scrappy Exp $
 | 
			
		||||
 * $Id: pg_listener.h,v 1.3 1997/09/07 04:56:54 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -18,38 +18,39 @@
 | 
			
		||||
#define PG_LISTENER_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *      pg_listener definition.
 | 
			
		||||
 *		pg_listener definition.
 | 
			
		||||
 *
 | 
			
		||||
 *      cpp turns this into typedef struct FormData_pg_listener
 | 
			
		||||
 *		cpp turns this into typedef struct FormData_pg_listener
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
CATALOG(pg_listener) {
 | 
			
		||||
    NameData       relname;
 | 
			
		||||
    int4         listenerpid;
 | 
			
		||||
    int4         notification;
 | 
			
		||||
CATALOG(pg_listener)
 | 
			
		||||
{
 | 
			
		||||
	NameData		relname;
 | 
			
		||||
	int4			listenerpid;
 | 
			
		||||
	int4			notification;
 | 
			
		||||
} FormData_pg_listener;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *      compiler constants for pg_listener
 | 
			
		||||
 *		compiler constants for pg_listener
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_listener                       3
 | 
			
		||||
#define Anum_pg_listener_relname                1
 | 
			
		||||
#define Anum_pg_listener_pid                    2
 | 
			
		||||
#define Anum_pg_listener_notify                 3
 | 
			
		||||
#define Natts_pg_listener						3
 | 
			
		||||
#define Anum_pg_listener_relname				1
 | 
			
		||||
#define Anum_pg_listener_pid					2
 | 
			
		||||
#define Anum_pg_listener_notify					3
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *      initial contents of pg_listener are NOTHING.
 | 
			
		||||
 *		initial contents of pg_listener are NOTHING.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_LISTENER_H */
 | 
			
		||||
#endif							/* PG_LISTENER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,19 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * 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.
 | 
			
		||||
 *	  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.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_log.h,v 1.2 1996/10/31 09:47:42 scrappy Exp $
 | 
			
		||||
 * $Id: pg_log.h,v 1.3 1997/09/07 04:56:55 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    The structures and macros used by the transam/ code
 | 
			
		||||
 *    to access pg_log should some day go here -cim 6/18/90
 | 
			
		||||
 *	  The structures and macros used by the transam/ code
 | 
			
		||||
 *	  to access pg_log should some day go here -cim 6/18/90
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,19 +21,20 @@
 | 
			
		||||
#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.
 | 
			
		||||
 *		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 {
 | 
			
		||||
    Oid  	logfoo;
 | 
			
		||||
CATALOG(pg_log) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				logfoo;
 | 
			
		||||
} FormData_pg_log;
 | 
			
		||||
 | 
			
		||||
typedef FormData_pg_log	*Form_pg_log;
 | 
			
		||||
typedef FormData_pg_log *Form_pg_log;
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_log		1
 | 
			
		||||
#define Anum_pg_log_logfoo	1
 | 
			
		||||
#define Natts_pg_log			1
 | 
			
		||||
#define Anum_pg_log_logfoo		1
 | 
			
		||||
 | 
			
		||||
#endif /* PG_LOG_H */
 | 
			
		||||
#endif							/* PG_LOG_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_magic.h--
 | 
			
		||||
 *    definition of the system "magic" relation (pg_magic)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "magic" relation (pg_magic)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_magic.h,v 1.2 1996/10/31 09:47:45 scrappy Exp $
 | 
			
		||||
 * $Id: pg_magic.h,v 1.3 1997/09/07 04:56:57 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,35 +19,36 @@
 | 
			
		||||
#define PG_MAGIC_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_magic definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_magic
 | 
			
		||||
 *		pg_magic definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_magic
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_magic) BOOTSTRAP {
 | 
			
		||||
    NameData 	magname;
 | 
			
		||||
    NameData 	magvalue;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_magic) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		magname;
 | 
			
		||||
	NameData		magvalue;
 | 
			
		||||
} FormData_pg_magic;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_magic corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_magic relation.
 | 
			
		||||
 *		Form_pg_magic corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_magic relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_magic	*Form_pg_magic;
 | 
			
		||||
typedef FormData_pg_magic *Form_pg_magic;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_magic
 | 
			
		||||
 *		compiler constants for pg_magic
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_magic			2
 | 
			
		||||
#define Anum_pg_magic_magname		1
 | 
			
		||||
#define Anum_pg_magic_magvalue		2
 | 
			
		||||
#define Natts_pg_magic					2
 | 
			
		||||
#define Anum_pg_magic_magname			1
 | 
			
		||||
#define Anum_pg_magic_magvalue			2
 | 
			
		||||
 | 
			
		||||
#endif /* PG_MAGIC_H */
 | 
			
		||||
#endif							/* PG_MAGIC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_opclass.h--
 | 
			
		||||
 *    definition of the system "opclass" relation (pg_opclass)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "opclass" relation (pg_opclass)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_opclass.h,v 1.3 1997/09/04 18:43:58 thomas Exp $
 | 
			
		||||
 * $Id: pg_opclass.h,v 1.4 1997/09/07 04:56:58 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,40 +19,41 @@
 | 
			
		||||
#define PG_OPCLASS_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_opclass definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_opclass
 | 
			
		||||
 *		pg_opclass definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_opclass
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
CATALOG(pg_opclass) {
 | 
			
		||||
    NameData opcname;
 | 
			
		||||
    Oid opcdeftype;
 | 
			
		||||
CATALOG(pg_opclass)
 | 
			
		||||
{
 | 
			
		||||
	NameData		opcname;
 | 
			
		||||
	Oid				opcdeftype;
 | 
			
		||||
} FormData_pg_opclass;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_opclass corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_opclass relation.
 | 
			
		||||
 *		Form_pg_opclass corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_opclass relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_opclass	*Form_pg_opclass;
 | 
			
		||||
typedef FormData_pg_opclass *Form_pg_opclass;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_opclass
 | 
			
		||||
 *		compiler constants for pg_opclass
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_opclass		2
 | 
			
		||||
#define Anum_pg_opclass_opcname		1
 | 
			
		||||
#define Anum_pg_opclass_opcdeftype      2
 | 
			
		||||
#define Natts_pg_opclass				2
 | 
			
		||||
#define Anum_pg_opclass_opcname			1
 | 
			
		||||
#define Anum_pg_opclass_opcdeftype		2
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_opclass
 | 
			
		||||
 *		initial contents of pg_opclass
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -61,34 +62,34 @@ typedef FormData_pg_opclass	*Form_pg_opclass;
 | 
			
		||||
 * (see the README in this directory), so just put zeros
 | 
			
		||||
 * in, which are invalid OID's anyway.  --djm
 | 
			
		||||
 */
 | 
			
		||||
DATA(insert OID =  406 (    char2_ops       409   ));
 | 
			
		||||
DATA(insert OID =  407 (    char4_ops       410   ));
 | 
			
		||||
DATA(insert OID =  408 (    char8_ops       411   ));
 | 
			
		||||
DATA(insert OID = 1181 (    name_ops         19   ));
 | 
			
		||||
DATA(insert OID =  421 (    int2_ops         21   ));
 | 
			
		||||
DATA(insert OID =  422 (    box_ops         603   ));
 | 
			
		||||
DATA(insert OID =  423 (    float8_ops      701   ));
 | 
			
		||||
DATA(insert OID =  424 (    int24_ops         0   ));
 | 
			
		||||
DATA(insert OID =  425 (    int42_ops         0   ));
 | 
			
		||||
DATA(insert OID =  426 (    int4_ops         23   ));
 | 
			
		||||
DATA(insert OID =  406 (	char2_ops		409   ));
 | 
			
		||||
DATA(insert OID =  407 (	char4_ops		410   ));
 | 
			
		||||
DATA(insert OID =  408 (	char8_ops		411   ));
 | 
			
		||||
DATA(insert OID = 1181 (	name_ops		 19   ));
 | 
			
		||||
DATA(insert OID =  421 (	int2_ops		 21   ));
 | 
			
		||||
DATA(insert OID =  422 (	box_ops			603   ));
 | 
			
		||||
DATA(insert OID =  423 (	float8_ops		701   ));
 | 
			
		||||
DATA(insert OID =  424 (	int24_ops		  0   ));
 | 
			
		||||
DATA(insert OID =  425 (	int42_ops		  0   ));
 | 
			
		||||
DATA(insert OID =  426 (	int4_ops		 23   ));
 | 
			
		||||
#define INT4_OPS_OID 426
 | 
			
		||||
DATA(insert OID =  427 (    oid_ops          26   ));
 | 
			
		||||
DATA(insert OID =  428 (    float4_ops      700   ));
 | 
			
		||||
DATA(insert OID =  429 (    char_ops         18   ));
 | 
			
		||||
DATA(insert OID =  430 (    char16_ops       20   ));
 | 
			
		||||
DATA(insert OID =  431 (    text_ops         25   ));
 | 
			
		||||
DATA(insert OID =  432 (    abstime_ops     702   ));
 | 
			
		||||
DATA(insert OID =  433 (    bigbox_ops        0   ));
 | 
			
		||||
DATA(insert OID =  434 (    poly_ops        604   ));
 | 
			
		||||
DATA(insert OID =  435 (    oidint4_ops     910   ));
 | 
			
		||||
DATA(insert OID =  436 (    oidname_ops     911   ));
 | 
			
		||||
DATA(insert OID =  437 (    oidint2_ops     810   ));
 | 
			
		||||
DATA(insert OID =  714 (    circle_ops      718   ));
 | 
			
		||||
DATA(insert OID = 1076 (    bpchar_ops     1042   ));
 | 
			
		||||
DATA(insert OID = 1077 (    varchar_ops    1043   ));
 | 
			
		||||
DATA(insert OID = 1114 (    date_ops       1082   ));
 | 
			
		||||
DATA(insert OID = 1115 (    time_ops       1083   ));
 | 
			
		||||
DATA(insert OID = 1312 (    datetime_ops   1184   ));
 | 
			
		||||
DATA(insert OID = 1313 (    timespan_ops   1186   ));
 | 
			
		||||
DATA(insert OID =  427 (	oid_ops			 26   ));
 | 
			
		||||
DATA(insert OID =  428 (	float4_ops		700   ));
 | 
			
		||||
DATA(insert OID =  429 (	char_ops		 18   ));
 | 
			
		||||
DATA(insert OID =  430 (	char16_ops		 20   ));
 | 
			
		||||
DATA(insert OID =  431 (	text_ops		 25   ));
 | 
			
		||||
DATA(insert OID =  432 (	abstime_ops		702   ));
 | 
			
		||||
DATA(insert OID =  433 (	bigbox_ops		  0   ));
 | 
			
		||||
DATA(insert OID =  434 (	poly_ops		604   ));
 | 
			
		||||
DATA(insert OID =  435 (	oidint4_ops		910   ));
 | 
			
		||||
DATA(insert OID =  436 (	oidname_ops		911   ));
 | 
			
		||||
DATA(insert OID =  437 (	oidint2_ops		810   ));
 | 
			
		||||
DATA(insert OID =  714 (	circle_ops		718   ));
 | 
			
		||||
DATA(insert OID = 1076 (	bpchar_ops	   1042   ));
 | 
			
		||||
DATA(insert OID = 1077 (	varchar_ops    1043   ));
 | 
			
		||||
DATA(insert OID = 1114 (	date_ops	   1082   ));
 | 
			
		||||
DATA(insert OID = 1115 (	time_ops	   1083   ));
 | 
			
		||||
DATA(insert OID = 1312 (	datetime_ops   1184   ));
 | 
			
		||||
DATA(insert OID = 1313 (	timespan_ops   1186   ));
 | 
			
		||||
 | 
			
		||||
#endif /* PG_OPCLASS_H */
 | 
			
		||||
#endif							/* PG_OPCLASS_H */
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -1,18 +1,18 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_parg.h--
 | 
			
		||||
 *    definition of the system "parg" relation (pg_parg)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "parg" relation (pg_parg)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 * [whatever this relation was, it doesn't seem to be used anymore --djm]
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_parg.h,v 1.3 1996/11/13 20:51:00 scrappy Exp $
 | 
			
		||||
 * $Id: pg_parg.h,v 1.4 1997/09/07 04:57:01 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -20,43 +20,44 @@
 | 
			
		||||
#define PG_PARG_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_parg definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_parg
 | 
			
		||||
 *		pg_parg definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_parg
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_parg) {
 | 
			
		||||
    Oid 	parproid;
 | 
			
		||||
    int2 	parnum;
 | 
			
		||||
    char 	parbound;
 | 
			
		||||
    Oid 	partype;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_parg)
 | 
			
		||||
{
 | 
			
		||||
	Oid				parproid;
 | 
			
		||||
	int2			parnum;
 | 
			
		||||
	char			parbound;
 | 
			
		||||
	Oid				partype;
 | 
			
		||||
} FormData_pg_parg;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_parg corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_parg relation.
 | 
			
		||||
 *		Form_pg_parg corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_parg relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_parg	*Form_pg_parg;
 | 
			
		||||
typedef FormData_pg_parg *Form_pg_parg;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_parg
 | 
			
		||||
 *		compiler constants for pg_parg
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_parg			4
 | 
			
		||||
#define Anum_pg_parg_parproid		1
 | 
			
		||||
#define Anum_pg_parg_parnum		2
 | 
			
		||||
#define Anum_pg_parg_parbound		3
 | 
			
		||||
#define Anum_pg_parg_partype		4
 | 
			
		||||
#define Natts_pg_parg					4
 | 
			
		||||
#define Anum_pg_parg_parproid			1
 | 
			
		||||
#define Anum_pg_parg_parnum				2
 | 
			
		||||
#define Anum_pg_parg_parbound			3
 | 
			
		||||
#define Anum_pg_parg_partype			4
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_parg
 | 
			
		||||
 *		initial contents of pg_parg
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
@@ -113,4 +114,4 @@ DATA(insert OID = 0 (  66 2 - 23 ));
 | 
			
		||||
DATA(insert OID = 0 (  67 1 - 25 ));
 | 
			
		||||
DATA(insert OID = 0 (  67 2 - 25 ));
 | 
			
		||||
 | 
			
		||||
#endif /* PG_PARG_H */
 | 
			
		||||
#endif							/* PG_PARG_H */
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -6,8 +6,8 @@
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -15,39 +15,40 @@
 | 
			
		||||
#define PG_RELCHECK_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_relcheck definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_relcheck
 | 
			
		||||
 *		pg_relcheck definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_relcheck
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_relcheck) BOOTSTRAP {
 | 
			
		||||
    Oid		rcrelid;
 | 
			
		||||
    NameData	rcname;
 | 
			
		||||
    text	rcbin;
 | 
			
		||||
    text	rcsrc;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_relcheck) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				rcrelid;
 | 
			
		||||
	NameData		rcname;
 | 
			
		||||
	text			rcbin;
 | 
			
		||||
	text			rcsrc;
 | 
			
		||||
} FormData_pg_relcheck;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_relcheck corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_relcheck relation.
 | 
			
		||||
 *		Form_pg_relcheck corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_relcheck relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_relcheck	*Form_pg_relcheck;
 | 
			
		||||
typedef FormData_pg_relcheck *Form_pg_relcheck;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_relcheck
 | 
			
		||||
 *		compiler constants for pg_relcheck
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_relcheck		4
 | 
			
		||||
#define Anum_pg_relcheck_rcrelid	1
 | 
			
		||||
#define Anum_pg_relcheck_rcname		2
 | 
			
		||||
#define Anum_pg_relcheck_rcbin		3
 | 
			
		||||
#define Anum_pg_relcheck_rcsrc		4
 | 
			
		||||
#define Natts_pg_relcheck				4
 | 
			
		||||
#define Anum_pg_relcheck_rcrelid		1
 | 
			
		||||
#define Anum_pg_relcheck_rcname			2
 | 
			
		||||
#define Anum_pg_relcheck_rcbin			3
 | 
			
		||||
#define Anum_pg_relcheck_rcsrc			4
 | 
			
		||||
 | 
			
		||||
#endif /* PG_RELCHECK_H */
 | 
			
		||||
#endif							/* PG_RELCHECK_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_rewrite.h--
 | 
			
		||||
 *    definition of the system "rewrite-rule" relation (pg_rewrite)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "rewrite-rule" relation (pg_rewrite)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_rewrite.h,v 1.2 1996/10/31 09:47:54 scrappy Exp $
 | 
			
		||||
 * $Id: pg_rewrite.h,v 1.3 1997/09/07 04:57:08 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,45 +19,46 @@
 | 
			
		||||
#define PG_REWRITE_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_rewrite definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_rewrite
 | 
			
		||||
 *		pg_rewrite definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_rewrite
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_rewrite) {
 | 
			
		||||
    NameData 	rulename;
 | 
			
		||||
    char 	ev_type;
 | 
			
		||||
    Oid 	ev_class;
 | 
			
		||||
    int2 	ev_attr;
 | 
			
		||||
    bool 	is_instead;
 | 
			
		||||
    text	ev_qual;	/* VARLENA */
 | 
			
		||||
    text 	action;		/* VARLENA */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_rewrite)
 | 
			
		||||
{
 | 
			
		||||
	NameData		rulename;
 | 
			
		||||
	char			ev_type;
 | 
			
		||||
	Oid				ev_class;
 | 
			
		||||
	int2			ev_attr;
 | 
			
		||||
	bool			is_instead;
 | 
			
		||||
	text			ev_qual;	/* VARLENA */
 | 
			
		||||
	text			action;		/* VARLENA */
 | 
			
		||||
} FormData_pg_rewrite;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_rewrite corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_rewrite relation.
 | 
			
		||||
 *		Form_pg_rewrite corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_rewrite relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_rewrite *Form_pg_rewrite;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_rewrite
 | 
			
		||||
 *		compiler constants for pg_rewrite
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_rewrite		7
 | 
			
		||||
#define Anum_pg_rewrite_rulename	1
 | 
			
		||||
#define Anum_pg_rewrite_ev_type 	2
 | 
			
		||||
#define Anum_pg_rewrite_ev_class	3
 | 
			
		||||
#define Anum_pg_rewrite_ev_attr  	4
 | 
			
		||||
#define Anum_pg_rewrite_is_instead      5
 | 
			
		||||
#define Anum_pg_rewrite_ev_qual		6
 | 
			
		||||
#define Anum_pg_rewrite_action	        7
 | 
			
		||||
#define Natts_pg_rewrite				7
 | 
			
		||||
#define Anum_pg_rewrite_rulename		1
 | 
			
		||||
#define Anum_pg_rewrite_ev_type			2
 | 
			
		||||
#define Anum_pg_rewrite_ev_class		3
 | 
			
		||||
#define Anum_pg_rewrite_ev_attr			4
 | 
			
		||||
#define Anum_pg_rewrite_is_instead		5
 | 
			
		||||
#define Anum_pg_rewrite_ev_qual			6
 | 
			
		||||
#define Anum_pg_rewrite_action			7
 | 
			
		||||
 | 
			
		||||
#endif /* PG_REWRITE_H */
 | 
			
		||||
#endif							/* PG_REWRITE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_server.h--
 | 
			
		||||
 *    definition of the system "server" relation (pg_server)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "server" relation (pg_server)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_server.h,v 1.2 1996/10/31 09:47:55 scrappy Exp $
 | 
			
		||||
 * $Id: pg_server.h,v 1.3 1997/09/07 04:57:09 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,37 +19,38 @@
 | 
			
		||||
#define PG_SERVER_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_server definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_server
 | 
			
		||||
 *		pg_server definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_server
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_server) BOOTSTRAP {
 | 
			
		||||
    NameData 	sername;
 | 
			
		||||
    int2 	serpid;
 | 
			
		||||
    int2 	serport;
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_server) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		sername;
 | 
			
		||||
	int2			serpid;
 | 
			
		||||
	int2			serport;
 | 
			
		||||
} FormData_pg_server;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_server corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_server relation.
 | 
			
		||||
 *		Form_pg_server corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_server relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_server	*Form_pg_server;
 | 
			
		||||
typedef FormData_pg_server *Form_pg_server;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_server
 | 
			
		||||
 *		compiler constants for pg_server
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_server			3
 | 
			
		||||
#define Anum_pg_server_sername		1
 | 
			
		||||
#define Anum_pg_server_serpid		2
 | 
			
		||||
#define Anum_pg_server_serport		3
 | 
			
		||||
#define Natts_pg_server					3
 | 
			
		||||
#define Anum_pg_server_sername			1
 | 
			
		||||
#define Anum_pg_server_serpid			2
 | 
			
		||||
#define Anum_pg_server_serport			3
 | 
			
		||||
 | 
			
		||||
#endif /* PG_SERVER_H */
 | 
			
		||||
#endif							/* PG_SERVER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_statistic.h--
 | 
			
		||||
 *    definition of the system "statistic" relation (pg_statistic)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "statistic" relation (pg_statistic)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_statistic.h,v 1.2 1996/10/31 09:47:57 scrappy Exp $
 | 
			
		||||
 * $Id: pg_statistic.h,v 1.3 1997/09/07 04:57:10 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,41 +19,42 @@
 | 
			
		||||
#define PG_STATISTIC_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_statistic definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_statistic
 | 
			
		||||
 *		pg_statistic definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_statistic
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_statistic) {
 | 
			
		||||
    Oid 	starelid;
 | 
			
		||||
    int2 	staattnum;
 | 
			
		||||
    Oid 	staop;
 | 
			
		||||
    text 	stalokey;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
    text 	stahikey;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_statistic)
 | 
			
		||||
{
 | 
			
		||||
	Oid				starelid;
 | 
			
		||||
	int2			staattnum;
 | 
			
		||||
	Oid				staop;
 | 
			
		||||
	text			stalokey;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
	text			stahikey;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
} FormData_pg_statistic;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_statistic corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_statistic relation.
 | 
			
		||||
 *		Form_pg_statistic corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_statistic relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_statistic	*Form_pg_statistic;
 | 
			
		||||
typedef FormData_pg_statistic *Form_pg_statistic;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_statistic
 | 
			
		||||
 *		compiler constants for pg_statistic
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_statistic		5
 | 
			
		||||
#define Anum_pg_statistic_starelid	1
 | 
			
		||||
#define Anum_pg_statistic_staattnum	2
 | 
			
		||||
#define Anum_pg_statistic_staop		3
 | 
			
		||||
#define Anum_pg_statistic_stalokey	4
 | 
			
		||||
#define Anum_pg_statistic_stahikey	5
 | 
			
		||||
#define Natts_pg_statistic				5
 | 
			
		||||
#define Anum_pg_statistic_starelid		1
 | 
			
		||||
#define Anum_pg_statistic_staattnum		2
 | 
			
		||||
#define Anum_pg_statistic_staop			3
 | 
			
		||||
#define Anum_pg_statistic_stalokey		4
 | 
			
		||||
#define Anum_pg_statistic_stahikey		5
 | 
			
		||||
 | 
			
		||||
#endif /* PG_STATISTIC_H */
 | 
			
		||||
#endif							/* PG_STATISTIC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,19 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_time.h--
 | 
			
		||||
 *    the system commit-time relation "pg_time" 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.
 | 
			
		||||
 *	  the system commit-time relation "pg_time" 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.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_time.h,v 1.2 1996/10/31 09:47:58 scrappy Exp $
 | 
			
		||||
 * $Id: pg_time.h,v 1.3 1997/09/07 04:57:10 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    The structures and macros used by the transam/ code
 | 
			
		||||
 *    to access pg_time should some day go here -cim 6/18/90
 | 
			
		||||
 *	  The structures and macros used by the transam/ code
 | 
			
		||||
 *	  to access pg_time should some day go here -cim 6/18/90
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,20 +21,21 @@
 | 
			
		||||
#define PG_TIME_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.
 | 
			
		||||
 *		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_time) BOOTSTRAP {
 | 
			
		||||
    Oid  	timefoo;
 | 
			
		||||
CATALOG(pg_time) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				timefoo;
 | 
			
		||||
} FormData_pg_time;
 | 
			
		||||
 | 
			
		||||
typedef FormData_pg_time	*Form_pg_time;
 | 
			
		||||
typedef FormData_pg_time *Form_pg_time;
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_time		1
 | 
			
		||||
#define Natts_pg_time			1
 | 
			
		||||
#define Anum_pg_time_timefoo	1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_TIME_H */
 | 
			
		||||
#endif							/* PG_TIME_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -15,65 +15,67 @@
 | 
			
		||||
#define PG_TRIGGER_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_trigger definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_trigger
 | 
			
		||||
 *		pg_trigger definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_trigger
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_trigger) BOOTSTRAP {
 | 
			
		||||
    Oid		tgrelid;	/* triggered relation */
 | 
			
		||||
    NameData	tgname;		/* trigger' name */
 | 
			
		||||
    Oid		tgfoid;		/* OID of function to be called */
 | 
			
		||||
    int2	tgtype;		/* BEFORE/AFTER UPDATE/DELETE/INSERT ROW/STATEMENT */
 | 
			
		||||
    int2	tgnargs;	/* # of extra arguments in tgargs */
 | 
			
		||||
    int28	tgattr;		/* UPDATE of attr1, attr2 ... (NI) */
 | 
			
		||||
    bytea	tgargs;		/* first\000second\000tgnargs\000 */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_trigger) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				tgrelid;	/* triggered relation */
 | 
			
		||||
	NameData		tgname;		/* trigger' name */
 | 
			
		||||
	Oid				tgfoid;		/* OID of function to be called */
 | 
			
		||||
	int2			tgtype;		/* BEFORE/AFTER UPDATE/DELETE/INSERT
 | 
			
		||||
								 * ROW/STATEMENT */
 | 
			
		||||
	int2			tgnargs;	/* # of extra arguments in tgargs */
 | 
			
		||||
	int28			tgattr;		/* UPDATE of attr1, attr2 ... (NI) */
 | 
			
		||||
	bytea			tgargs;		/* first\000second\000tgnargs\000 */
 | 
			
		||||
} FormData_pg_trigger;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_trigger corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_trigger relation.
 | 
			
		||||
 *		Form_pg_trigger corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_trigger relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_trigger	*Form_pg_trigger;
 | 
			
		||||
typedef FormData_pg_trigger *Form_pg_trigger;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_trigger
 | 
			
		||||
 *		compiler constants for pg_trigger
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_trigger		7
 | 
			
		||||
#define Anum_pg_trigger_tgrelid		1
 | 
			
		||||
#define Anum_pg_trigger_tgname		2
 | 
			
		||||
#define Anum_pg_trigger_tgfoid		3
 | 
			
		||||
#define Anum_pg_trigger_tgtype		4
 | 
			
		||||
#define Anum_pg_trigger_tgnargs		5
 | 
			
		||||
#define Anum_pg_trigger_tgattr		6
 | 
			
		||||
#define Anum_pg_trigger_tgargs		7
 | 
			
		||||
#define Natts_pg_trigger				7
 | 
			
		||||
#define Anum_pg_trigger_tgrelid			1
 | 
			
		||||
#define Anum_pg_trigger_tgname			2
 | 
			
		||||
#define Anum_pg_trigger_tgfoid			3
 | 
			
		||||
#define Anum_pg_trigger_tgtype			4
 | 
			
		||||
#define Anum_pg_trigger_tgnargs			5
 | 
			
		||||
#define Anum_pg_trigger_tgattr			6
 | 
			
		||||
#define Anum_pg_trigger_tgargs			7
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_TYPE_ROW		(1 << 0)
 | 
			
		||||
#define TRIGGER_TYPE_BEFORE		(1 << 1)
 | 
			
		||||
#define TRIGGER_TYPE_INSERT		(1 << 2)
 | 
			
		||||
#define TRIGGER_TYPE_DELETE		(1 << 3)
 | 
			
		||||
#define TRIGGER_TYPE_UPDATE		(1 << 4)
 | 
			
		||||
#define TRIGGER_TYPE_ROW				(1 << 0)
 | 
			
		||||
#define TRIGGER_TYPE_BEFORE				(1 << 1)
 | 
			
		||||
#define TRIGGER_TYPE_INSERT				(1 << 2)
 | 
			
		||||
#define TRIGGER_TYPE_DELETE				(1 << 3)
 | 
			
		||||
#define TRIGGER_TYPE_UPDATE				(1 << 4)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_CLEAR_TYPE(type)	(type = 0)
 | 
			
		||||
#define TRIGGER_CLEAR_TYPE(type)		(type = 0)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_SETT_ROW(type)		(type |= TRIGGER_TYPE_ROW)
 | 
			
		||||
#define TRIGGER_SETT_BEFORE(type)	(type |= TRIGGER_TYPE_BEFORE)
 | 
			
		||||
#define TRIGGER_SETT_INSERT(type)	(type |= TRIGGER_TYPE_INSERT)
 | 
			
		||||
#define TRIGGER_SETT_DELETE(type)	(type |= TRIGGER_TYPE_DELETE)
 | 
			
		||||
#define TRIGGER_SETT_UPDATE(type)	(type |= TRIGGER_TYPE_UPDATE)
 | 
			
		||||
#define TRIGGER_SETT_ROW(type)			(type |= TRIGGER_TYPE_ROW)
 | 
			
		||||
#define TRIGGER_SETT_BEFORE(type)		(type |= TRIGGER_TYPE_BEFORE)
 | 
			
		||||
#define TRIGGER_SETT_INSERT(type)		(type |= TRIGGER_TYPE_INSERT)
 | 
			
		||||
#define TRIGGER_SETT_DELETE(type)		(type |= TRIGGER_TYPE_DELETE)
 | 
			
		||||
#define TRIGGER_SETT_UPDATE(type)		(type |= TRIGGER_TYPE_UPDATE)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FOR_ROW(type)		(type & TRIGGER_TYPE_ROW)
 | 
			
		||||
#define TRIGGER_FOR_BEFORE(type)	(type & TRIGGER_TYPE_BEFORE)
 | 
			
		||||
#define TRIGGER_FOR_INSERT(type)	(type & TRIGGER_TYPE_INSERT)
 | 
			
		||||
#define TRIGGER_FOR_DELETE(type)	(type & TRIGGER_TYPE_DELETE)
 | 
			
		||||
#define TRIGGER_FOR_UPDATE(type)	(type & TRIGGER_TYPE_UPDATE)
 | 
			
		||||
#define TRIGGER_FOR_ROW(type)			(type & TRIGGER_TYPE_ROW)
 | 
			
		||||
#define TRIGGER_FOR_BEFORE(type)		(type & TRIGGER_TYPE_BEFORE)
 | 
			
		||||
#define TRIGGER_FOR_INSERT(type)		(type & TRIGGER_TYPE_INSERT)
 | 
			
		||||
#define TRIGGER_FOR_DELETE(type)		(type & TRIGGER_TYPE_DELETE)
 | 
			
		||||
#define TRIGGER_FOR_UPDATE(type)		(type & TRIGGER_TYPE_UPDATE)
 | 
			
		||||
 | 
			
		||||
#endif /* PG_TRIGGER_H */
 | 
			
		||||
#endif							/* PG_TRIGGER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_type.h--
 | 
			
		||||
 *    definition of the system "type" relation (pg_type)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "type" relation (pg_type)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_type.h,v 1.16 1997/08/31 09:55:24 vadim Exp $
 | 
			
		||||
 * $Id: pg_type.h,v 1.17 1997/09/07 04:57:12 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,212 +21,220 @@
 | 
			
		||||
#include <utils/rel.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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_type definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_type
 | 
			
		||||
 *		pg_type definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_type
 | 
			
		||||
 *
 | 
			
		||||
 *      Some of the values in a pg_type instance are copied into 
 | 
			
		||||
 *      pg_attribute instances.  Some parts of Postgres use the pg_type copy,
 | 
			
		||||
 *      while others use the pg_attribute copy, so they must match.
 | 
			
		||||
 *      See struct FormData_pg_attribute for details.
 | 
			
		||||
 *		Some of the values in a pg_type instance are copied into
 | 
			
		||||
 *		pg_attribute instances.  Some parts of Postgres use the pg_type copy,
 | 
			
		||||
 *		while others use the pg_attribute copy, so they must match.
 | 
			
		||||
 *		See struct FormData_pg_attribute for details.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_type) BOOTSTRAP {
 | 
			
		||||
    NameData 	typname;
 | 
			
		||||
    Oid  	typowner;
 | 
			
		||||
    int2  	typlen;
 | 
			
		||||
      /* typlen is the number of bytes we use to represent a value of
 | 
			
		||||
         this type, e.g. 4 for an int4.  But for a variable length
 | 
			
		||||
         type, typlen is -1.  
 | 
			
		||||
         */
 | 
			
		||||
    int2  	typprtlen;
 | 
			
		||||
    bool  	typbyval;
 | 
			
		||||
      /* typbyval determines whether internal Postgres routines pass a value
 | 
			
		||||
         of this type by value or by reference.  Postgres uses a 4 byte 
 | 
			
		||||
         area for passing a field value info, so if the value is not 1, 2,
 | 
			
		||||
         or 4 bytes long, Postgres does not have the option of passing by
 | 
			
		||||
         value and ignores typbyval.  
 | 
			
		||||
CATALOG(pg_type) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		typname;
 | 
			
		||||
	Oid				typowner;
 | 
			
		||||
	int2			typlen;
 | 
			
		||||
 | 
			
		||||
         (I don't understand why this column exists.  The above description
 | 
			
		||||
         may be an oversimplification.  Also, there appear to be bugs in which
 | 
			
		||||
         Postgres doesn't ignore typbyval when it should, but I'm 
 | 
			
		||||
         afraid to change them until I see proof of damage. -BRYANH 96.08).
 | 
			
		||||
	/*
 | 
			
		||||
	 * typlen is the number of bytes we use to represent a value of this
 | 
			
		||||
	 * type, e.g. 4 for an int4.  But for a variable length type, typlen
 | 
			
		||||
	 * is -1.
 | 
			
		||||
	 */
 | 
			
		||||
	int2			typprtlen;
 | 
			
		||||
	bool			typbyval;
 | 
			
		||||
 | 
			
		||||
         (Postgres crashes if typbyval is true, the declared length is 8,
 | 
			
		||||
         and the I/O routines are written to expect pass by reference.
 | 
			
		||||
         Note that float4 is written for pass by reference and has a declared length
 | 
			
		||||
         of 4 bytes, so it looks like pass by reference must be consistant
 | 
			
		||||
         with the declared length, and typbyval is used somewhere. - tgl 97/03/20)
 | 
			
		||||
         */
 | 
			
		||||
    char  	typtype;
 | 
			
		||||
    bool  	typisdefined;
 | 
			
		||||
    char	typdelim;
 | 
			
		||||
    Oid 	typrelid;
 | 
			
		||||
    Oid  	typelem;
 | 
			
		||||
      /* typelem is NULL if this is not an array type.  If this is an array
 | 
			
		||||
         type, typelem is the OID of the type of the elements of the array
 | 
			
		||||
         (it identifies another row in Table pg_type).
 | 
			
		||||
	/*
 | 
			
		||||
	 * typbyval determines whether internal Postgres routines pass a value
 | 
			
		||||
	 * of this type by value or by reference.  Postgres uses a 4 byte area
 | 
			
		||||
	 * for passing a field value info, so if the value is not 1, 2, or 4
 | 
			
		||||
	 * bytes long, Postgres does not have the option of passing by value
 | 
			
		||||
	 * and ignores typbyval.
 | 
			
		||||
	 *
 | 
			
		||||
	 * (I don't understand why this column exists.  The above description may
 | 
			
		||||
	 * be an oversimplification.  Also, there appear to be bugs in which
 | 
			
		||||
	 * Postgres doesn't ignore typbyval when it should, but I'm afraid to
 | 
			
		||||
	 * change them until I see proof of damage. -BRYANH 96.08).
 | 
			
		||||
	 *
 | 
			
		||||
	 * (Postgres crashes if typbyval is true, the declared length is 8, and
 | 
			
		||||
	 * the I/O routines are written to expect pass by reference. Note that
 | 
			
		||||
	 * float4 is written for pass by reference and has a declared length
 | 
			
		||||
	 * of 4 bytes, so it looks like pass by reference must be consistant
 | 
			
		||||
	 * with the declared length, and typbyval is used somewhere. - tgl
 | 
			
		||||
	 * 97/03/20)
 | 
			
		||||
	 */
 | 
			
		||||
	char			typtype;
 | 
			
		||||
	bool			typisdefined;
 | 
			
		||||
	char			typdelim;
 | 
			
		||||
	Oid				typrelid;
 | 
			
		||||
	Oid				typelem;
 | 
			
		||||
 | 
			
		||||
         (Note that zero ("0") rather than _null_ is used
 | 
			
		||||
         in the declarations. - tgl 97/03/20)
 | 
			
		||||
      */
 | 
			
		||||
    regproc  	typinput;
 | 
			
		||||
    regproc  	typoutput;
 | 
			
		||||
    regproc  	typreceive;
 | 
			
		||||
    regproc  	typsend;
 | 
			
		||||
    char	typalign;
 | 
			
		||||
      /* typalign is the alignment required when storing a value of this
 | 
			
		||||
         type.  It applies to storage on disk as well as most representations
 | 
			
		||||
         of the value inside Postgres.  When multiple values are stored 
 | 
			
		||||
         consecutively, such as in the representation of a complete row
 | 
			
		||||
         on disk, padding is inserted before a datum of this type so that it
 | 
			
		||||
         begins on the specified boundary.  The alignment reference is the 
 | 
			
		||||
         beginning of the first datum in the sequence.
 | 
			
		||||
	/*
 | 
			
		||||
	 * typelem is NULL if this is not an array type.  If this is an array
 | 
			
		||||
	 * type, typelem is the OID of the type of the elements of the array
 | 
			
		||||
	 * (it identifies another row in Table pg_type).
 | 
			
		||||
	 *
 | 
			
		||||
	 * (Note that zero ("0") rather than _null_ is used in the declarations.
 | 
			
		||||
	 * - tgl 97/03/20)
 | 
			
		||||
	 */
 | 
			
		||||
	regproc			typinput;
 | 
			
		||||
	regproc			typoutput;
 | 
			
		||||
	regproc			typreceive;
 | 
			
		||||
	regproc			typsend;
 | 
			
		||||
	char			typalign;
 | 
			
		||||
 | 
			
		||||
         'c' = 1 byte alignment.
 | 
			
		||||
         's' = 2 byte alignment.
 | 
			
		||||
         'i' = 4 byte alignment.
 | 
			
		||||
         'd' = 8 byte alignment.
 | 
			
		||||
 | 
			
		||||
         (This might actually be flexible depending on machine architecture,
 | 
			
		||||
         but I doubt it - BRYANH 96.08).
 | 
			
		||||
         */
 | 
			
		||||
    text     	typdefault;	/* VARIABLE LENGTH FIELD */
 | 
			
		||||
	/*
 | 
			
		||||
	 * typalign is the alignment required when storing a value of this
 | 
			
		||||
	 * type.  It applies to storage on disk as well as most
 | 
			
		||||
	 * representations of the value inside Postgres.  When multiple values
 | 
			
		||||
	 * are stored consecutively, such as in the representation of a
 | 
			
		||||
	 * complete row on disk, padding is inserted before a datum of this
 | 
			
		||||
	 * type so that it begins on the specified boundary.  The alignment
 | 
			
		||||
	 * reference is the beginning of the first datum in the sequence.
 | 
			
		||||
	 *
 | 
			
		||||
	 * 'c' = 1 byte alignment. 's' = 2 byte alignment. 'i' = 4 byte
 | 
			
		||||
	 * alignment. 'd' = 8 byte alignment.
 | 
			
		||||
	 *
 | 
			
		||||
	 * (This might actually be flexible depending on machine architecture,
 | 
			
		||||
	 * but I doubt it - BRYANH 96.08).
 | 
			
		||||
	 */
 | 
			
		||||
	text			typdefault; /* VARIABLE LENGTH FIELD */
 | 
			
		||||
} TypeTupleFormData;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_type corresponds to a pointer to a row with
 | 
			
		||||
 *	the format of pg_type relation.
 | 
			
		||||
 *		Form_pg_type corresponds to a pointer to a row with
 | 
			
		||||
 *		the format of pg_type relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef TypeTupleFormData	*TypeTupleForm;
 | 
			
		||||
typedef TypeTupleFormData *TypeTupleForm;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_type
 | 
			
		||||
 *		compiler constants for pg_type
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_type			16
 | 
			
		||||
#define Anum_pg_type_typname		1
 | 
			
		||||
#define Anum_pg_type_typowner		2
 | 
			
		||||
#define Anum_pg_type_typlen		3
 | 
			
		||||
#define Anum_pg_type_typprtlen		4
 | 
			
		||||
#define Anum_pg_type_typbyval		5
 | 
			
		||||
#define Anum_pg_type_typtype		6
 | 
			
		||||
#define Anum_pg_type_typisdefined	7
 | 
			
		||||
#define Anum_pg_type_typdelim     	8
 | 
			
		||||
#define Anum_pg_type_typrelid		9
 | 
			
		||||
#define Anum_pg_type_typelem		10
 | 
			
		||||
#define Anum_pg_type_typinput		11
 | 
			
		||||
#define Anum_pg_type_typoutput		12
 | 
			
		||||
#define Anum_pg_type_typreceive		13
 | 
			
		||||
#define Anum_pg_type_typsend		14
 | 
			
		||||
#define Anum_pg_type_typalign		15
 | 
			
		||||
#define Anum_pg_type_typdefault		16
 | 
			
		||||
#define Natts_pg_type					16
 | 
			
		||||
#define Anum_pg_type_typname			1
 | 
			
		||||
#define Anum_pg_type_typowner			2
 | 
			
		||||
#define Anum_pg_type_typlen				3
 | 
			
		||||
#define Anum_pg_type_typprtlen			4
 | 
			
		||||
#define Anum_pg_type_typbyval			5
 | 
			
		||||
#define Anum_pg_type_typtype			6
 | 
			
		||||
#define Anum_pg_type_typisdefined		7
 | 
			
		||||
#define Anum_pg_type_typdelim			8
 | 
			
		||||
#define Anum_pg_type_typrelid			9
 | 
			
		||||
#define Anum_pg_type_typelem			10
 | 
			
		||||
#define Anum_pg_type_typinput			11
 | 
			
		||||
#define Anum_pg_type_typoutput			12
 | 
			
		||||
#define Anum_pg_type_typreceive			13
 | 
			
		||||
#define Anum_pg_type_typsend			14
 | 
			
		||||
#define Anum_pg_type_typalign			15
 | 
			
		||||
#define Anum_pg_type_typdefault			16
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_type
 | 
			
		||||
 *		initial contents of pg_type
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* keep the following ordered by OID so that later changes can be made easier*/
 | 
			
		||||
 | 
			
		||||
/* Make sure the typlen, typbyval, and typalign values here match the initial
 | 
			
		||||
   values for attlen, attbyval, and attalign in both places in pg_attribute.h 
 | 
			
		||||
   values for attlen, attbyval, and attalign in both places in pg_attribute.h
 | 
			
		||||
   for every instance.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
/* OIDS 1 - 99 */
 | 
			
		||||
DATA(insert OID = 16 (  bool       PGUID  1   1 t b t \054 0   0 boolin boolout boolin boolout c _null_ ));
 | 
			
		||||
#define BOOLOID		16
 | 
			
		||||
DATA(insert OID = 16 (	bool	   PGUID  1   1 t b t \054 0   0 boolin boolout boolin boolout c _null_ ));
 | 
			
		||||
#define BOOLOID			16
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 17 (  bytea      PGUID -1  -1 f b t \054 0  18 byteain byteaout byteain byteaout i _null_ ));
 | 
			
		||||
DATA(insert OID = 18 (  char       PGUID  1   1 t b t \054 0   0 charin charout charin charout c _null_ ));
 | 
			
		||||
DATA(insert OID = 17 (	bytea	   PGUID -1  -1 f b t \054 0  18 byteain byteaout byteain byteaout i _null_ ));
 | 
			
		||||
DATA(insert OID = 18 (	char	   PGUID  1   1 t b t \054 0   0 charin charout charin charout c _null_ ));
 | 
			
		||||
#define CHAROID 18
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 19 (  name       PGUID NAMEDATALEN NAMEDATALEN  f b t \054 0  18 namein nameout namein nameout d _null_ ));
 | 
			
		||||
DATA(insert OID = 19 (	name	   PGUID NAMEDATALEN NAMEDATALEN  f b t \054 0	18 namein nameout namein nameout d _null_ ));
 | 
			
		||||
#define NAMEOID 19
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 20 (  char16     PGUID 16  16 f b t \054 0  18 char16in char16out char16in char16out i _null_ ));
 | 
			
		||||
DATA(insert OID = 21 (  int2       PGUID  2   5 t b t \054 0   0 int2in int2out int2in int2out s _null_ ));
 | 
			
		||||
#define INT2OID		21
 | 
			
		||||
DATA(insert OID = 20 (	char16	   PGUID 16  16 f b t \054 0  18 char16in char16out char16in char16out i _null_ ));
 | 
			
		||||
DATA(insert OID = 21 (	int2	   PGUID  2   5 t b t \054 0   0 int2in int2out int2in int2out s _null_ ));
 | 
			
		||||
#define INT2OID			21
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 22 (  int28      PGUID 16  50 f b t \054 0  21 int28in int28out int28in int28out i _null_ ));
 | 
			
		||||
DATA(insert OID = 22 (	int28	   PGUID 16  50 f b t \054 0  21 int28in int28out int28in int28out i _null_ ));
 | 
			
		||||
/*
 | 
			
		||||
 * XXX -- the implementation of int28's in postgres is a hack, and will
 | 
			
		||||
 *	  go away someday.  until that happens, there is a case (in the
 | 
			
		||||
 *	  catalog cache management code) where we need to step gingerly
 | 
			
		||||
 *	  over piles of int28's on the sidewalk.  in order to do so, we
 | 
			
		||||
 *	  need the OID of the int28 row from pg_type.
 | 
			
		||||
 *		  go away someday.	until that happens, there is a case (in the
 | 
			
		||||
 *		  catalog cache management code) where we need to step gingerly
 | 
			
		||||
 *		  over piles of int28's on the sidewalk.  in order to do so, we
 | 
			
		||||
 *		  need the OID of the int28 row from pg_type.
 | 
			
		||||
 */
 | 
			
		||||
#define INT28OID	22
 | 
			
		||||
#define INT28OID		22
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 23 (  int4       PGUID  4  10 t b t \054 0   0 int4in int4out int4in int4out i _null_ ));
 | 
			
		||||
#define INT4OID		23
 | 
			
		||||
DATA(insert OID = 23 (	int4	   PGUID  4  10 t b t \054 0   0 int4in int4out int4in int4out i _null_ ));
 | 
			
		||||
#define INT4OID			23
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 24 (  regproc    PGUID  4  16 t b t \054 0   0 regprocin regprocout regprocin regprocout i _null_ ));
 | 
			
		||||
DATA(insert OID = 25 (  text       PGUID -1  -1 f b t \054 0  18 textin textout textin textout i _null_ ));
 | 
			
		||||
DATA(insert OID = 24 (	regproc    PGUID  4  16 t b t \054 0   0 regprocin regprocout regprocin regprocout i _null_ ));
 | 
			
		||||
DATA(insert OID = 25 (	text	   PGUID -1  -1 f b t \054 0  18 textin textout textin textout i _null_ ));
 | 
			
		||||
#define TEXTOID 25
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 26 (  oid        PGUID  4  10 t b t \054 0   0 int4in int4out int4in int4out i _null_ ));
 | 
			
		||||
#define OIDOID		26
 | 
			
		||||
DATA(insert OID = 26 (	oid		   PGUID  4  10 t b t \054 0   0 int4in int4out int4in int4out i _null_ ));
 | 
			
		||||
#define OIDOID			26
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 27 (  tid        PGUID  6  19 f b t \054 0   0 tidin tidout tidin tidout i _null_ ));
 | 
			
		||||
DATA(insert OID = 28 (  xid        PGUID  4  12 t b t \054 0   0 xidin xidout xidin xidout i _null_ ));
 | 
			
		||||
DATA(insert OID = 29 (  cid        PGUID  2   3 t b t \054 0   0 cidin cidout cidin cidout s _null_ ));
 | 
			
		||||
DATA(insert OID = 30 (  oid8       PGUID 32  89 f b t \054 0  26 oid8in oid8out oid8in oid8out i _null_ ));
 | 
			
		||||
DATA(insert OID = 32 (  SET        PGUID -1  -1 f r t \054 0  -1 textin textout textin textout i _null_ ));
 | 
			
		||||
DATA(insert OID = 27 (	tid		   PGUID  6  19 f b t \054 0   0 tidin tidout tidin tidout i _null_ ));
 | 
			
		||||
DATA(insert OID = 28 (	xid		   PGUID  4  12 t b t \054 0   0 xidin xidout xidin xidout i _null_ ));
 | 
			
		||||
DATA(insert OID = 29 (	cid		   PGUID  2   3 t b t \054 0   0 cidin cidout cidin cidout s _null_ ));
 | 
			
		||||
DATA(insert OID = 30 (	oid8	   PGUID 32  89 f b t \054 0  26 oid8in oid8out oid8in oid8out i _null_ ));
 | 
			
		||||
DATA(insert OID = 32 (	SET		   PGUID -1  -1 f r t \054 0  -1 textin textout textin textout i _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 71 (  pg_type      PGUID 1 1 t b t \054 1247 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 75 (  pg_attribute PGUID 1 1 t b t \054 1249 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 76 (  pg_demon     PGUID 1 1 t b t \054 1251 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 80 (  pg_magic     PGUID 1 1 t b t \054 1253 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 81 (  pg_proc      PGUID 1 1 t b t \054 1255 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 82 (  pg_server    PGUID 1 1 t b t \054 1257 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 83 (  pg_class     PGUID 1 1 t b t \054 1259 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 86 (  pg_user      PGUID 1 1 t b t \054 1260 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 87 (  pg_group     PGUID 1 1 t b t \054 1261 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 88 (  pg_database  PGUID 1 1 t b t \054 1262 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 89 (  pg_defaults  PGUID 1 1 t b t \054 1263 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 90 (  pg_variable  PGUID 1 1 t b t \054 1264 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 99 (  pg_log       PGUID 1 1 t b t \054 1269 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 71 (	pg_type		 PGUID 1 1 t b t \054 1247 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 75 (	pg_attribute PGUID 1 1 t b t \054 1249 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 76 (	pg_demon	 PGUID 1 1 t b t \054 1251 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 80 (	pg_magic	 PGUID 1 1 t b t \054 1253 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 81 (	pg_proc		 PGUID 1 1 t b t \054 1255 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 82 (	pg_server	 PGUID 1 1 t b t \054 1257 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 83 (	pg_class	 PGUID 1 1 t b t \054 1259 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 86 (	pg_user		 PGUID 1 1 t b t \054 1260 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 87 (	pg_group	 PGUID 1 1 t b t \054 1261 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 88 (	pg_database  PGUID 1 1 t b t \054 1262 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 89 (	pg_defaults  PGUID 1 1 t b t \054 1263 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 90 (	pg_variable  PGUID 1 1 t b t \054 1264 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 99 (	pg_log		 PGUID 1 1 t b t \054 1269 0 foo bar foo bar c _null_));
 | 
			
		||||
 | 
			
		||||
/* OIDS 100 - 199 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 100 (  pg_time     PGUID 1 1 t b t \054 1271 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 101 (  pg_hosts    PGUID 1 1 t b t \054 1273 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 100 (  pg_time	 PGUID 1 1 t b t \054 1271 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 101 (  pg_hosts	 PGUID 1 1 t b t \054 1273 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 109 (  pg_attrdef  PGUID 1 1 t b t \054 1215 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 110 (  pg_relcheck PGUID 1 1 t b t \054 1216 0 foo bar foo bar c _null_));
 | 
			
		||||
DATA(insert OID = 111 (  pg_trigger  PGUID 1 1 t b t \054 1219 0 foo bar foo bar c _null_));
 | 
			
		||||
 | 
			
		||||
/* OIDS 200 - 299 */
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 210 (  smgr      PGUID 2  12 t b t \054 0  -1 smgrin smgrout smgrin smgrout s _null_ ));
 | 
			
		||||
DATA(insert OID = 210 (  smgr	   PGUID 2	12 t b t \054 0  -1 smgrin smgrout smgrin smgrout s _null_ ));
 | 
			
		||||
 | 
			
		||||
/* OIDS 300 - 399 */
 | 
			
		||||
 | 
			
		||||
/* OIDS 400 - 499 */
 | 
			
		||||
DATA(insert OID = 409 (  char2     PGUID 2  2 t b t \054 0  18 char2in char2out char2in char2out s _null_ ));
 | 
			
		||||
DATA(insert OID = 410 (  char4     PGUID 4  4 t b t \054 0  18 char4in char4out char4in char4out i _null_ ));
 | 
			
		||||
DATA(insert OID = 411 (  char8     PGUID 8  8 f b t \054 0  18 char8in char8out char8in char8out i _null_ ));
 | 
			
		||||
DATA(insert OID = 409 (  char2	   PGUID 2	2 t b t \054 0	18 char2in char2out char2in char2out s _null_ ));
 | 
			
		||||
DATA(insert OID = 410 (  char4	   PGUID 4	4 t b t \054 0	18 char4in char4out char4in char4out i _null_ ));
 | 
			
		||||
DATA(insert OID = 411 (  char8	   PGUID 8	8 f b t \054 0	18 char8in char8out char8in char8out i _null_ ));
 | 
			
		||||
 | 
			
		||||
/* OIDS 500 - 599 */
 | 
			
		||||
 | 
			
		||||
/* OIDS 600 - 699 */
 | 
			
		||||
DATA(insert OID = 600 (  point     PGUID 16  24 f b t \054 0 701 point_in point_out point_in point_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 601 (  lseg      PGUID 32  48 f b t \054 0 600 lseg_in lseg_out lseg_in lseg_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 602 (  path      PGUID -1  -1 f b t \054 0 600 path_in path_out path_in path_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 603 (  box       PGUID 32 100 f b t \073 0 600 box_in box_out box_in box_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 600 (  point	   PGUID 16  24 f b t \054 0 701 point_in point_out point_in point_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 601 (  lseg	   PGUID 32  48 f b t \054 0 600 lseg_in lseg_out lseg_in lseg_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 602 (  path	   PGUID -1  -1 f b t \054 0 600 path_in path_out path_in path_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 603 (  box	   PGUID 32 100 f b t \073 0 600 box_in box_out box_in box_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 604 (  polygon   PGUID -1  -1 f b t \054 0  -1 poly_in poly_out poly_in poly_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 605 (  filename  PGUID 256 -1 f b t \054 0  18 filename_in filename_out filename_in filename_out i _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 628 (  line      PGUID 32  48 f b t \054 0 701 line_in line_out line_in line_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 629 (  _line     PGUID  -1 -1 f b t \054 0 628 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 628 (  line	   PGUID 32  48 f b t \054 0 701 line_in line_out line_in line_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 629 (  _line	   PGUID  -1 -1 f b t \054 0 628 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
 | 
			
		||||
/* OIDS 700 - 799 */
 | 
			
		||||
 | 
			
		||||
@@ -238,11 +246,11 @@ DATA(insert OID = 702 (  abstime   PGUID  4  20 t b t \054 0   0 nabstimein nabs
 | 
			
		||||
DATA(insert OID = 703 (  reltime   PGUID  4  20 t b t \054 0   0 reltimein reltimeout reltimein reltimeout i _null_ ));
 | 
			
		||||
DATA(insert OID = 704 (  tinterval PGUID 12  47 f b t \054 0   0 tintervalin tintervalout tintervalin tintervalout i _null_ ));
 | 
			
		||||
DATA(insert OID = 705 (  unknown   PGUID -1  -1 f b t \054 0   18 textin textout textin textout i _null_ ));
 | 
			
		||||
#define UNKNOWNOID	705
 | 
			
		||||
#define UNKNOWNOID		705
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 718 (  circle    PGUID  24 47 f b t \054 0    0 circle_in circle_out circle_in circle_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 718 (  circle    PGUID  24 47 f b t \054 0	0 circle_in circle_out circle_in circle_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 719 (  _circle   PGUID  -1 -1 f b t \054 0  718 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 790 (  money     PGUID   4 24 f b t \054 0    0 cash_in cash_out cash_in cash_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 790 (  money	   PGUID   4 24 f b t \054 0	0 cash_in cash_out cash_in cash_out i _null_ ));
 | 
			
		||||
#define CASHOID 790
 | 
			
		||||
DATA(insert OID = 791 (  _money    PGUID  -1 -1 f b t \054 0  790 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
 | 
			
		||||
@@ -254,87 +262,88 @@ DATA(insert OID = 910 (  oidint4   PGUID  8  20 f b t \054 0   0 oidint4in oidin
 | 
			
		||||
DATA(insert OID = 911 (  oidname   PGUID  OIDNAMELEN OIDNAMELEN f b t \054 0   0 oidnamein oidnameout oidnamein oidnameout i _null_ ));
 | 
			
		||||
 | 
			
		||||
/* OIDS 1000 - 1099 */
 | 
			
		||||
DATA(insert OID = 1000 (  _bool      PGUID -1  -1 f b t \054 0  16 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1001 (  _bytea     PGUID -1  -1 f b t \054 0  17 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1002 (  _char      PGUID -1  -1 f b t \054 0  18 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1003 (  _name      PGUID -1  -1 f b t \054 0  19 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1004 (  _char16    PGUID -1  -1 f b t \054 0  20 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1005 (  _int2      PGUID -1  -1 f b t \054 0  21 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1006 (  _int28     PGUID -1  -1 f b t \054 0  22 array_in array_out array_in array_out i _null_ )); 
 | 
			
		||||
DATA(insert OID = 1007 (  _int4      PGUID -1  -1 f b t \054 0  23 array_in array_out array_in array_out i _null_ ));  
 | 
			
		||||
DATA(insert OID = 1008 (  _regproc   PGUID -1  -1 f b t \054 0  24 array_in array_out array_in array_out i _null_ ));  
 | 
			
		||||
DATA(insert OID = 1009 (  _text      PGUID -1  -1 f b t \054 0  25 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1028 (  _oid       PGUID -1  -1 f b t \054 0  26 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1010 (  _tid       PGUID -1  -1 f b t \054 0  27 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1011 (  _xid       PGUID -1  -1 f b t \054 0  28 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1012 (  _cid       PGUID -1  -1 f b t \054 0  29 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1013 (  _oid8      PGUID -1  -1 f b t \054 0  30 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
/*DATA(insert OID = 1014 (  _lock      PGUID -1  -1 f b t \054 0  31 array_in array_out array_in array_out i _null_ ));*/
 | 
			
		||||
DATA(insert OID = 1015 (  _stub      PGUID -1  -1 f b t \054 0  33 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1016 (  _ref 	     PGUID -1  -1 f b t \054 0 591 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1017 (  _point     PGUID -1  -1 f b t \054 0 600 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1018 (  _lseg      PGUID -1  -1 f b t \054 0 601 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1019 (  _path      PGUID -1  -1 f b t \054 0 602 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1020 (  _box       PGUID -1  -1 f b t \073 0 603 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1021 (  _float4    PGUID -1  -1 f b t \054 0 700 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1022 (  _float8    PGUID -1  -1 f b t \054 0 701 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1023 (  _abstime   PGUID -1  -1 f b t \054 0 702 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1024 (  _reltime   PGUID -1  -1 f b t \054 0 703 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1000 (  _bool		 PGUID -1  -1 f b t \054 0	16 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1001 (  _bytea	 PGUID -1  -1 f b t \054 0	17 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1002 (  _char		 PGUID -1  -1 f b t \054 0	18 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1003 (  _name		 PGUID -1  -1 f b t \054 0	19 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1004 (  _char16	 PGUID -1  -1 f b t \054 0	20 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1005 (  _int2		 PGUID -1  -1 f b t \054 0	21 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1006 (  _int28	 PGUID -1  -1 f b t \054 0	22 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1007 (  _int4		 PGUID -1  -1 f b t \054 0	23 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1008 (  _regproc	 PGUID -1  -1 f b t \054 0	24 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1009 (  _text		 PGUID -1  -1 f b t \054 0	25 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1028 (  _oid		 PGUID -1  -1 f b t \054 0	26 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1010 (  _tid		 PGUID -1  -1 f b t \054 0	27 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1011 (  _xid		 PGUID -1  -1 f b t \054 0	28 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1012 (  _cid		 PGUID -1  -1 f b t \054 0	29 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1013 (  _oid8		 PGUID -1  -1 f b t \054 0	30 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1014 (  _lock		 PGUID -1  -1 f b t \054 0	31 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1015 (  _stub		 PGUID -1  -1 f b t \054 0	33 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1016 (  _ref		 PGUID -1  -1 f b t \054 0 591 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1017 (  _point	 PGUID -1  -1 f b t \054 0 600 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1018 (  _lseg		 PGUID -1  -1 f b t \054 0 601 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1019 (  _path		 PGUID -1  -1 f b t \054 0 602 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1020 (  _box		 PGUID -1  -1 f b t \073 0 603 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1021 (  _float4	 PGUID -1  -1 f b t \054 0 700 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1022 (  _float8	 PGUID -1  -1 f b t \054 0 701 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1023 (  _abstime	 PGUID -1  -1 f b t \054 0 702 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1024 (  _reltime	 PGUID -1  -1 f b t \054 0 703 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1025 (  _tinterval PGUID -1  -1 f b t \054 0 704 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1026 (  _filename  PGUID -1  -1 f b t \054 0 605 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1027 (  _polygon   PGUID -1  -1 f b t \054 0 604 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1027 (  _polygon	 PGUID -1  -1 f b t \054 0 604 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
/* Note: the size of an aclitem needs to match sizeof(AclItem) in acl.h */
 | 
			
		||||
DATA(insert OID = 1033 (  aclitem    PGUID 8   -1 f b t \054 0 0 aclitemin aclitemout aclitemin aclitemout i _null_ ));
 | 
			
		||||
DATA(insert OID = 1034 (  _aclitem   PGUID -1  -1 f b t \054 0 1033 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1033 (  aclitem	 PGUID 8   -1 f b t \054 0 0 aclitemin aclitemout aclitemin aclitemout i _null_ ));
 | 
			
		||||
DATA(insert OID = 1034 (  _aclitem	 PGUID -1  -1 f b t \054 0 1033 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 1039 (  _char2     PGUID -1  -1 f b t \054 0  409 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1040 (  _char4     PGUID -1  -1 f b t \054 0  410 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1041 (  _char8     PGUID -1  -1 f b t \054 0  411 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1039 (  _char2	 PGUID -1  -1 f b t \054 0	409 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1040 (  _char4	 PGUID -1  -1 f b t \054 0	410 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1041 (  _char8	 PGUID -1  -1 f b t \054 0	411 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 1042 ( bpchar      PGUID -1  -1 f b t \054 0  18 bpcharin bpcharout bpcharin bpcharout i _null_ ));
 | 
			
		||||
#define	BPCHAROID	1042
 | 
			
		||||
DATA(insert OID = 1043 ( varchar     PGUID -1  -1 f b t \054 0  18 varcharin varcharout varcharin varcharout i _null_ ));
 | 
			
		||||
#define	VARCHAROID	1043
 | 
			
		||||
DATA(insert OID = 1042 ( bpchar		 PGUID -1  -1 f b t \054 0	18 bpcharin bpcharout bpcharin bpcharout i _null_ ));
 | 
			
		||||
#define BPCHAROID		1042
 | 
			
		||||
DATA(insert OID = 1043 ( varchar	 PGUID -1  -1 f b t \054 0	18 varcharin varcharout varcharin varcharout i _null_ ));
 | 
			
		||||
#define VARCHAROID		1043
 | 
			
		||||
 | 
			
		||||
DATA(insert OID = 1082 ( date        PGUID  4  10 t b t \054 0  0 date_in date_out date_in date_out i _null_ ));
 | 
			
		||||
#define DATEOID		1082
 | 
			
		||||
DATA(insert OID = 1083 ( time        PGUID  8  16 f b t \054 0  0 time_in time_out time_in time_out d _null_ ));
 | 
			
		||||
#define TIMEOID		1083
 | 
			
		||||
DATA(insert OID = 1082 ( date		 PGUID	4  10 t b t \054 0	0 date_in date_out date_in date_out i _null_ ));
 | 
			
		||||
#define DATEOID			1082
 | 
			
		||||
DATA(insert OID = 1083 ( time		 PGUID	8  16 f b t \054 0	0 time_in time_out time_in time_out d _null_ ));
 | 
			
		||||
#define TIMEOID			1083
 | 
			
		||||
 | 
			
		||||
/* OIDS 1100 - 1199 */
 | 
			
		||||
DATA(insert OID = 1182 ( _date       PGUID  -1 -1 f b t \054 0  1082 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1183 ( _time       PGUID  -1 -1 f b t \054 0  1083 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1184 ( datetime    PGUID  8  47 f b t \054 0  0 datetime_in datetime_out datetime_in datetime_out d _null_ ));
 | 
			
		||||
#define DATETIMEOID	1184
 | 
			
		||||
DATA(insert OID = 1185 ( _datetime   PGUID  -1 -1 f b t \054 0  1184 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1186 ( timespan    PGUID 12  47 f b t \054 0  0 timespan_in timespan_out timespan_in timespan_out d _null_ ));
 | 
			
		||||
#define TIMESPANOID	1186
 | 
			
		||||
DATA(insert OID = 1187 ( _timespan   PGUID  -1 -1 f b t \054 0  1186 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1182 ( _date		 PGUID	-1 -1 f b t \054 0	1082 array_in array_out array_in array_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1183 ( _time		 PGUID	-1 -1 f b t \054 0	1083 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1184 ( datetime	 PGUID	8  47 f b t \054 0	0 datetime_in datetime_out datetime_in datetime_out d _null_ ));
 | 
			
		||||
#define DATETIMEOID		1184
 | 
			
		||||
DATA(insert OID = 1185 ( _datetime	 PGUID	-1 -1 f b t \054 0	1184 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
DATA(insert OID = 1186 ( timespan	 PGUID 12  47 f b t \054 0	0 timespan_in timespan_out timespan_in timespan_out d _null_ ));
 | 
			
		||||
#define TIMESPANOID		1186
 | 
			
		||||
DATA(insert OID = 1187 ( _timespan	 PGUID	-1 -1 f b t \054 0	1186 array_in array_out array_in array_out d _null_ ));
 | 
			
		||||
 | 
			
		||||
/* OIDS 1200 - 1299 */
 | 
			
		||||
DATA(insert OID = 1296 ( timestamp   PGUID  4  19 t b t \054 0  0 timestamp_in timestamp_out timestamp_in timestamp_out i _null_ ));
 | 
			
		||||
DATA(insert OID = 1296 ( timestamp	 PGUID	4  19 t b t \054 0	0 timestamp_in timestamp_out timestamp_in timestamp_out i _null_ ));
 | 
			
		||||
#define TIMESTAMPOID	1296
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes for functions in pg_type.c 
 | 
			
		||||
 * prototypes for functions in pg_type.c
 | 
			
		||||
 */
 | 
			
		||||
extern Oid TypeGet(char *typeName, bool *defined);
 | 
			
		||||
extern Oid TypeShellMake(char *typeName);
 | 
			
		||||
extern Oid TypeCreate(char *typeName, 
 | 
			
		||||
		      Oid relationOid,
 | 
			
		||||
		      int16 internalSize, 
 | 
			
		||||
		      int16 externalSize, 
 | 
			
		||||
		      char typeType,
 | 
			
		||||
		      char typDelim, 
 | 
			
		||||
		      char *inputProcedure, 
 | 
			
		||||
		      char *outputProcedure,
 | 
			
		||||
		      char *sendProcedure, 
 | 
			
		||||
		      char *receiveProcedure,
 | 
			
		||||
		      char *elementTypeName,
 | 
			
		||||
		      char *defaultTypeValue,
 | 
			
		||||
		      bool passedByValue, char alignment);
 | 
			
		||||
extern void TypeRename(char *oldTypeName, char *newTypeName);
 | 
			
		||||
extern char *makeArrayTypeName(char *typeName);
 | 
			
		||||
extern Oid		TypeGet(char *typeName, bool * defined);
 | 
			
		||||
extern Oid		TypeShellMake(char *typeName);
 | 
			
		||||
extern Oid
 | 
			
		||||
TypeCreate(char *typeName,
 | 
			
		||||
		   Oid relationOid,
 | 
			
		||||
		   int16 internalSize,
 | 
			
		||||
		   int16 externalSize,
 | 
			
		||||
		   char typeType,
 | 
			
		||||
		   char typDelim,
 | 
			
		||||
		   char *inputProcedure,
 | 
			
		||||
		   char *outputProcedure,
 | 
			
		||||
		   char *sendProcedure,
 | 
			
		||||
		   char *receiveProcedure,
 | 
			
		||||
		   char *elementTypeName,
 | 
			
		||||
		   char *defaultTypeValue,
 | 
			
		||||
		   bool passedByValue, char alignment);
 | 
			
		||||
extern void		TypeRename(char *oldTypeName, char *newTypeName);
 | 
			
		||||
extern char    *makeArrayTypeName(char *typeName);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_TYPE_H */
 | 
			
		||||
#endif							/* PG_TYPE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_user.h--
 | 
			
		||||
 *    definition of the system "user" relation (pg_user)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "user" relation (pg_user)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_user.h,v 1.3 1996/11/03 23:49:07 scrappy Exp $
 | 
			
		||||
 * $Id: pg_user.h,v 1.4 1997/09/07 04:57:13 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,43 +21,44 @@
 | 
			
		||||
 | 
			
		||||
/* Prototype required for superuser() from superuser.c */
 | 
			
		||||
 | 
			
		||||
bool superuser(void);
 | 
			
		||||
bool			superuser(void);
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_user definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_user
 | 
			
		||||
 *		pg_user definition.  cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_user
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_user) BOOTSTRAP {
 | 
			
		||||
    NameData 	usename;
 | 
			
		||||
    int4 	usesysid;
 | 
			
		||||
    bool 	usecreatedb;
 | 
			
		||||
    bool 	usetrace;
 | 
			
		||||
    bool 	usesuper;
 | 
			
		||||
    bool 	usecatupd;  
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_user) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	NameData		usename;
 | 
			
		||||
	int4			usesysid;
 | 
			
		||||
	bool			usecreatedb;
 | 
			
		||||
	bool			usetrace;
 | 
			
		||||
	bool			usesuper;
 | 
			
		||||
	bool			usecatupd;
 | 
			
		||||
} FormData_pg_user;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_user corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_user relation.
 | 
			
		||||
 *		Form_pg_user corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_user relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_user	*Form_pg_user;
 | 
			
		||||
typedef FormData_pg_user *Form_pg_user;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_user
 | 
			
		||||
 *		compiler constants for pg_user
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_user			6
 | 
			
		||||
#define Anum_pg_user_usename		1
 | 
			
		||||
#define Anum_pg_user_usesysid		2
 | 
			
		||||
#define Anum_pg_user_usecreatedb	3
 | 
			
		||||
#define Anum_pg_user_usetrace		4
 | 
			
		||||
#define Anum_pg_user_usesuper		5
 | 
			
		||||
#define Anum_pg_user_usecatupd		6
 | 
			
		||||
#define Natts_pg_user					6
 | 
			
		||||
#define Anum_pg_user_usename			1
 | 
			
		||||
#define Anum_pg_user_usesysid			2
 | 
			
		||||
#define Anum_pg_user_usecreatedb		3
 | 
			
		||||
#define Anum_pg_user_usetrace			4
 | 
			
		||||
#define Anum_pg_user_usesuper			5
 | 
			
		||||
#define Anum_pg_user_usecatupd			6
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	initial contents of pg_user
 | 
			
		||||
 *		initial contents of pg_user
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
DATA(insert OID = 0 ( postgres PGUID t t t t ));
 | 
			
		||||
@@ -88,9 +89,9 @@ DATA(insert OID = 0 ( marcel 31113 t t t t ));
 | 
			
		||||
DATA(insert OID = 0 ( ginger 3692 t t t t ));
 | 
			
		||||
DATA(insert OID = 0 ( woodruff 31026 t t t t ));
 | 
			
		||||
DATA(insert OID = 0 ( searcher 8261 t t t t ));
 | 
			
		||||
     
 | 
			
		||||
 | 
			
		||||
BKI_BEGIN
 | 
			
		||||
#endif /* ALLOW_PG_GROUP */
 | 
			
		||||
#endif							/* ALLOW_PG_GROUP */
 | 
			
		||||
BKI_END
 | 
			
		||||
 | 
			
		||||
#endif /* PG_USER_H */
 | 
			
		||||
#endif							/* PG_USER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,19 +1,19 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_variable.h--
 | 
			
		||||
 *    the system variable relation "pg_variable" 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.
 | 
			
		||||
 *	  the system variable relation "pg_variable" 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.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_variable.h,v 1.2 1996/10/31 09:48:02 scrappy Exp $
 | 
			
		||||
 * $Id: pg_variable.h,v 1.3 1997/09/07 04:57:15 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    The structures and macros used by the transam/ code
 | 
			
		||||
 *    to access pg_variable should someday go here -cim 6/18/90
 | 
			
		||||
 *	  The structures and macros used by the transam/ code
 | 
			
		||||
 *	  to access pg_variable should someday go here -cim 6/18/90
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -21,19 +21,20 @@
 | 
			
		||||
#define PG_VARIABLE_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.
 | 
			
		||||
 *		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_variable) BOOTSTRAP {
 | 
			
		||||
    Oid  	varfoo;
 | 
			
		||||
CATALOG(pg_variable) BOOTSTRAP
 | 
			
		||||
{
 | 
			
		||||
	Oid				varfoo;
 | 
			
		||||
} FormData_pg_variable;
 | 
			
		||||
 | 
			
		||||
typedef FormData_pg_variable	*Form_pg_variable;
 | 
			
		||||
typedef FormData_pg_variable *Form_pg_variable;
 | 
			
		||||
 | 
			
		||||
#define Natts_pg_variable	1
 | 
			
		||||
#define Anum_pg_variable_varfoo	1
 | 
			
		||||
#define Natts_pg_variable		1
 | 
			
		||||
#define Anum_pg_variable_varfoo 1
 | 
			
		||||
 | 
			
		||||
#endif /* PG_VARIABLE_H */
 | 
			
		||||
#endif							/* PG_VARIABLE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * pg_version.h--
 | 
			
		||||
 *    definition of the system "version" relation (pg_version)
 | 
			
		||||
 *    along with the relation's initial contents.
 | 
			
		||||
 *	  definition of the system "version" relation (pg_version)
 | 
			
		||||
 *	  along with the relation's initial contents.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: pg_version.h,v 1.3 1996/11/06 10:29:23 scrappy Exp $
 | 
			
		||||
 * $Id: pg_version.h,v 1.4 1997/09/07 04:57:17 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 * NOTES
 | 
			
		||||
 *    the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *    information from the DATA() statements.
 | 
			
		||||
 *	  the genbki.sh script reads this file and generates .bki
 | 
			
		||||
 *	  information from the DATA() statements.
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,38 +19,39 @@
 | 
			
		||||
#define PG_VERSION_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.
 | 
			
		||||
 *		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.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	pg_version definition.  cpp turns this into
 | 
			
		||||
 *	typedef struct FormData_pg_version
 | 
			
		||||
 *		pg_version definition.	cpp turns this into
 | 
			
		||||
 *		typedef struct FormData_pg_version
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */ 
 | 
			
		||||
CATALOG(pg_version) {
 | 
			
		||||
    Oid 	verrelid;
 | 
			
		||||
    Oid 	verbaseid;
 | 
			
		||||
    int4	vertime;  /* really should be some abstime */
 | 
			
		||||
 */
 | 
			
		||||
CATALOG(pg_version)
 | 
			
		||||
{
 | 
			
		||||
	Oid				verrelid;
 | 
			
		||||
	Oid				verbaseid;
 | 
			
		||||
	int4			vertime;	/* really should be some abstime */
 | 
			
		||||
} FormData_pg_version;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Form_pg_version corresponds to a pointer to a tuple with
 | 
			
		||||
 *	the format of pg_version relation.
 | 
			
		||||
 *		Form_pg_version corresponds to a pointer to a tuple with
 | 
			
		||||
 *		the format of pg_version relation.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef FormData_pg_version	*VersionTupleForm;
 | 
			
		||||
typedef FormData_pg_version *VersionTupleForm;
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	compiler constants for pg_version
 | 
			
		||||
 *		compiler constants for pg_version
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define Natts_pg_version		3
 | 
			
		||||
#define Anum_pg_version_verrelid	1
 | 
			
		||||
#define Anum_pg_version_verbaseid	2
 | 
			
		||||
#define Anum_pg_version_vertime		3
 | 
			
		||||
#define Natts_pg_version				3
 | 
			
		||||
#define Anum_pg_version_verrelid		1
 | 
			
		||||
#define Anum_pg_version_verbaseid		2
 | 
			
		||||
#define Anum_pg_version_vertime			3
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* PG_VERSION_H */
 | 
			
		||||
#endif							/* PG_VERSION_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,26 +1,26 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * async.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: async.h,v 1.5 1997/08/19 21:38:03 momjian Exp $
 | 
			
		||||
 * $Id: async.h,v 1.6 1997/09/07 04:57:19 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	ASYNC_H
 | 
			
		||||
#define	ASYNC_H
 | 
			
		||||
#ifndef ASYNC_H
 | 
			
		||||
#define ASYNC_H
 | 
			
		||||
 | 
			
		||||
#include <nodes/memnodes.h>
 | 
			
		||||
 | 
			
		||||
extern void Async_NotifyHandler(SIGNAL_ARGS);
 | 
			
		||||
extern void Async_Notify(char *relname);
 | 
			
		||||
extern void Async_NotifyAtCommit(void);
 | 
			
		||||
extern void Async_NotifyAtAbort(void);
 | 
			
		||||
extern void Async_Listen(char *relname, int pid);
 | 
			
		||||
extern void		Async_NotifyHandler(SIGNAL_ARGS);
 | 
			
		||||
extern void		Async_Notify(char *relname);
 | 
			
		||||
extern void		Async_NotifyAtCommit(void);
 | 
			
		||||
extern void		Async_NotifyAtAbort(void);
 | 
			
		||||
extern void		Async_Listen(char *relname, int pid);
 | 
			
		||||
 | 
			
		||||
extern GlobalMemory notifyContext;
 | 
			
		||||
 | 
			
		||||
#endif	/* ASYNC_H */
 | 
			
		||||
#endif							/* ASYNC_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,27 +1,27 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * cluster.h--
 | 
			
		||||
 *    header file for postgres cluster command stuff 
 | 
			
		||||
 *	  header file for postgres cluster command stuff
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994-5, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: cluster.h,v 1.2 1997/08/19 21:38:06 momjian Exp $
 | 
			
		||||
 * $Id: cluster.h,v 1.3 1997/09/07 04:57:21 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	CLUSTER_H
 | 
			
		||||
#define	CLUSTER_H
 | 
			
		||||
#ifndef CLUSTER_H
 | 
			
		||||
#define CLUSTER_H
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * defines for contant stuff
 | 
			
		||||
 */
 | 
			
		||||
#define _TEMP_RELATION_KEY_ 		"clXXXXXXXX"
 | 
			
		||||
#define _SIZE_OF_TEMP_RELATION_KEY_ 	11
 | 
			
		||||
#define _TEMP_RELATION_KEY_				"clXXXXXXXX"
 | 
			
		||||
#define _SIZE_OF_TEMP_RELATION_KEY_		11
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * functions
 | 
			
		||||
 */
 | 
			
		||||
extern void cluster(char oldrelname[], char oldindexname[]);
 | 
			
		||||
extern void		cluster(char oldrelname[], char oldindexname[]);
 | 
			
		||||
 | 
			
		||||
#endif	/* CLUSTER_H */
 | 
			
		||||
#endif							/* CLUSTER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * command.h--
 | 
			
		||||
 *    prototypes for command.c.
 | 
			
		||||
 *	  prototypes for command.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: command.h,v 1.4 1997/08/19 21:38:07 momjian Exp $
 | 
			
		||||
 * $Id: command.h,v 1.5 1997/09/07 04:57:22 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,29 +19,31 @@ extern MemoryContext PortalExecutorHeapMemory;
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * PerformPortalFetch --
 | 
			
		||||
 *	Performs the POSTQUEL function FETCH.  Fetches count (or all if 0)
 | 
			
		||||
 *		Performs the POSTQUEL function FETCH.  Fetches count (or all if 0)
 | 
			
		||||
 * tuples in portal with name in the forward direction iff goForward.
 | 
			
		||||
 *
 | 
			
		||||
 * Exceptions:
 | 
			
		||||
 *	BadArg if forward invalid.
 | 
			
		||||
 *	"WARN" if portal not found.
 | 
			
		||||
 *		BadArg if forward invalid.
 | 
			
		||||
 *		"WARN" if portal not found.
 | 
			
		||||
 */
 | 
			
		||||
extern void PerformPortalFetch(char *name, bool forward, int count,
 | 
			
		||||
			       char *tag, CommandDest dest);
 | 
			
		||||
extern void
 | 
			
		||||
PerformPortalFetch(char *name, bool forward, int count,
 | 
			
		||||
				   char *tag, CommandDest dest);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * PerformPortalClose --
 | 
			
		||||
 *	Performs the POSTQUEL function CLOSE.
 | 
			
		||||
 *		Performs the POSTQUEL function CLOSE.
 | 
			
		||||
 */
 | 
			
		||||
extern void PerformPortalClose(char *name, CommandDest dest);
 | 
			
		||||
extern void		PerformPortalClose(char *name, CommandDest dest);
 | 
			
		||||
 | 
			
		||||
extern void PortalCleanup(Portal portal);
 | 
			
		||||
extern void		PortalCleanup(Portal portal);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * PerformAddAttribute --
 | 
			
		||||
 *	Performs the POSTQUEL function ADD.
 | 
			
		||||
 *		Performs the POSTQUEL function ADD.
 | 
			
		||||
 */
 | 
			
		||||
extern void PerformAddAttribute(char *relationName, char *userName,
 | 
			
		||||
				bool inh, ColumnDef *colDef);
 | 
			
		||||
extern void
 | 
			
		||||
PerformAddAttribute(char *relationName, char *userName,
 | 
			
		||||
					bool inh, ColumnDef * colDef);
 | 
			
		||||
 | 
			
		||||
#endif /* COMMAND_H */
 | 
			
		||||
#endif							/* COMMAND_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * copy.h--
 | 
			
		||||
 *    Definitions for using the POSTGRES copy command.
 | 
			
		||||
 *	  Definitions for using the POSTGRES copy command.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: copy.h,v 1.2 1996/10/31 09:48:12 scrappy Exp $
 | 
			
		||||
 * $Id: copy.h,v 1.3 1997/09/07 04:57:23 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef COPY_H
 | 
			
		||||
#define	COPY_H
 | 
			
		||||
#define COPY_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, char *filename,
 | 
			
		||||
	    char *delim);
 | 
			
		||||
void
 | 
			
		||||
DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, char *filename,
 | 
			
		||||
	   char *delim);
 | 
			
		||||
 | 
			
		||||
#endif	/* COPY_H */
 | 
			
		||||
#endif							/* COPY_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,20 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * creatinh.h--
 | 
			
		||||
 *    prototypes for creatinh.c.
 | 
			
		||||
 *	  prototypes for creatinh.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: creatinh.h,v 1.1 1996/08/28 07:21:45 scrappy Exp $
 | 
			
		||||
 * $Id: creatinh.h,v 1.2 1997/09/07 04:57:24 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef CREATINH_H
 | 
			
		||||
#define CREATINH_H
 | 
			
		||||
 | 
			
		||||
extern void DefineRelation(CreateStmt *stmt);
 | 
			
		||||
extern void RemoveRelation(char *name);
 | 
			
		||||
extern char* MakeArchiveName(Oid relid);
 | 
			
		||||
extern void		DefineRelation(CreateStmt * stmt);
 | 
			
		||||
extern void		RemoveRelation(char *name);
 | 
			
		||||
extern char    *MakeArchiveName(Oid relid);
 | 
			
		||||
 | 
			
		||||
#endif	/* CREATINH_H */
 | 
			
		||||
#endif							/* CREATINH_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * defrem.h--
 | 
			
		||||
 *    POSTGRES define and remove utility definitions.
 | 
			
		||||
 *	  POSTGRES define and remove utility definitions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: defrem.h,v 1.7 1997/05/22 00:15:47 scrappy Exp $
 | 
			
		||||
 * $Id: defrem.h,v 1.8 1997/09/07 04:57:25 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	DEFREM_H
 | 
			
		||||
#ifndef DEFREM_H
 | 
			
		||||
#define DEFREM_H
 | 
			
		||||
 | 
			
		||||
#include <tcop/dest.h>
 | 
			
		||||
@@ -19,35 +19,38 @@
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes in defind.c
 | 
			
		||||
 */
 | 
			
		||||
extern void DefineIndex(char *heapRelationName, 
 | 
			
		||||
extern void
 | 
			
		||||
DefineIndex(char *heapRelationName,
 | 
			
		||||
			char *indexRelationName,
 | 
			
		||||
			char *accessMethodName,
 | 
			
		||||
			List *attributeList,
 | 
			
		||||
			List *parameterList, 
 | 
			
		||||
			List * attributeList,
 | 
			
		||||
			List * parameterList,
 | 
			
		||||
			bool unique,
 | 
			
		||||
			Expr *predicate,
 | 
			
		||||
			List *rangetable);
 | 
			
		||||
extern void ExtendIndex(char *indexRelationName,
 | 
			
		||||
			Expr *predicate,
 | 
			
		||||
			List *rangetable);
 | 
			
		||||
extern void RemoveIndex(char *name);
 | 
			
		||||
			Expr * predicate,
 | 
			
		||||
			List * rangetable);
 | 
			
		||||
extern void
 | 
			
		||||
ExtendIndex(char *indexRelationName,
 | 
			
		||||
			Expr * predicate,
 | 
			
		||||
			List * rangetable);
 | 
			
		||||
extern void		RemoveIndex(char *name);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes in define.c
 | 
			
		||||
 */
 | 
			
		||||
extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest);
 | 
			
		||||
extern void DefineOperator(char *name, List *parameters);
 | 
			
		||||
extern void DefineAggregate(char *name, List *parameters);
 | 
			
		||||
extern void DefineType(char *name, List *parameters);
 | 
			
		||||
extern void CreateFunction(ProcedureStmt *stmt, CommandDest dest);
 | 
			
		||||
extern void		CreateFunction(ProcedureStmt * stmt, CommandDest dest);
 | 
			
		||||
extern void		DefineOperator(char *name, List * parameters);
 | 
			
		||||
extern void		DefineAggregate(char *name, List * parameters);
 | 
			
		||||
extern void		DefineType(char *name, List * parameters);
 | 
			
		||||
extern void		CreateFunction(ProcedureStmt * stmt, CommandDest dest);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes in remove.c
 | 
			
		||||
 */
 | 
			
		||||
extern void RemoveFunction(char *functionName, int nargs, List *argNameList);
 | 
			
		||||
extern void RemoveOperator(char *operatorName, 
 | 
			
		||||
extern void		RemoveFunction(char *functionName, int nargs, List * argNameList);
 | 
			
		||||
extern void
 | 
			
		||||
RemoveOperator(char *operatorName,
 | 
			
		||||
			   char *typeName1, char *typeName2);
 | 
			
		||||
extern void RemoveType(char *typeName);
 | 
			
		||||
extern void RemoveAggregate(char *aggName, char *aggType);
 | 
			
		||||
extern void		RemoveType(char *typeName);
 | 
			
		||||
extern void		RemoveAggregate(char *aggName, char *aggType);
 | 
			
		||||
 | 
			
		||||
#endif	/* DEFREM_H */
 | 
			
		||||
#endif							/* DEFREM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * explain.h--
 | 
			
		||||
 *    prototypes for explain.c
 | 
			
		||||
 *	  prototypes for explain.c
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994-5, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: explain.h,v 1.2 1997/01/16 14:56:34 momjian Exp $
 | 
			
		||||
 * $Id: explain.h,v 1.3 1997/09/07 04:57:26 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	EXPLAIN_H
 | 
			
		||||
#define	EXPLAIN_H
 | 
			
		||||
#ifndef EXPLAIN_H
 | 
			
		||||
#define EXPLAIN_H
 | 
			
		||||
 | 
			
		||||
extern void ExplainQuery(Query *query, bool verbose, CommandDest dest);
 | 
			
		||||
extern void		ExplainQuery(Query * query, bool verbose, CommandDest dest);
 | 
			
		||||
 | 
			
		||||
#endif	/* EXPLAIN_H*/
 | 
			
		||||
#endif							/* EXPLAIN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * purge.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: purge.h,v 1.1 1996/08/28 07:21:48 scrappy Exp $
 | 
			
		||||
 * $Id: purge.h,v 1.2 1997/09/07 04:57:26 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	PURGE_H
 | 
			
		||||
#define	PURGE_H
 | 
			
		||||
#ifndef PURGE_H
 | 
			
		||||
#define PURGE_H
 | 
			
		||||
 | 
			
		||||
extern int32 RelationPurge(char *relationName,
 | 
			
		||||
			   char *absoluteTimeString,
 | 
			
		||||
			   char *relativeTimeString);
 | 
			
		||||
extern int32
 | 
			
		||||
RelationPurge(char *relationName,
 | 
			
		||||
			  char *absoluteTimeString,
 | 
			
		||||
			  char *relativeTimeString);
 | 
			
		||||
 | 
			
		||||
#endif	/* PURGE_H */
 | 
			
		||||
#endif							/* PURGE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,17 +1,17 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * recipe.h--
 | 
			
		||||
 *    recipe handling routines
 | 
			
		||||
 *	  recipe handling routines
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: recipe.h,v 1.1 1996/08/28 07:21:50 scrappy Exp $
 | 
			
		||||
 * $Id: recipe.h,v 1.2 1997/09/07 04:57:28 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef RECIPE_H
 | 
			
		||||
#define RECIPE_H
 | 
			
		||||
 | 
			
		||||
extern void beginRecipe(RecipeStmt* stmt);
 | 
			
		||||
extern void		beginRecipe(RecipeStmt * stmt);
 | 
			
		||||
 | 
			
		||||
#endif /* RECIPE_H */
 | 
			
		||||
#endif							/* RECIPE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,26 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * rename.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: rename.h,v 1.1 1996/08/28 07:21:51 scrappy Exp $
 | 
			
		||||
 * $Id: rename.h,v 1.2 1997/09/07 04:57:30 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	RENAME_H
 | 
			
		||||
#define	RENAME_H
 | 
			
		||||
#ifndef RENAME_H
 | 
			
		||||
#define RENAME_H
 | 
			
		||||
 | 
			
		||||
extern void renameatt(char *relname, 
 | 
			
		||||
		      char *oldattname,
 | 
			
		||||
		      char *newattname, 
 | 
			
		||||
		      char *userName, int recurse);
 | 
			
		||||
extern void
 | 
			
		||||
renameatt(char *relname,
 | 
			
		||||
		  char *oldattname,
 | 
			
		||||
		  char *newattname,
 | 
			
		||||
		  char *userName, int recurse);
 | 
			
		||||
 | 
			
		||||
extern void renamerel(char *oldrelname,
 | 
			
		||||
		      char *newrelname);
 | 
			
		||||
extern void
 | 
			
		||||
renamerel(char *oldrelname,
 | 
			
		||||
		  char *newrelname);
 | 
			
		||||
 | 
			
		||||
#endif	/* RENAME_H */
 | 
			
		||||
#endif							/* RENAME_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * sequence.h--
 | 
			
		||||
 *    prototypes for sequence.c.
 | 
			
		||||
 *	  prototypes for sequence.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
@@ -9,25 +9,25 @@
 | 
			
		||||
#ifndef SEQUENCE_H
 | 
			
		||||
#define SEQUENCE_H
 | 
			
		||||
 | 
			
		||||
/* 
 | 
			
		||||
/*
 | 
			
		||||
 * Columns of a sequnece relation
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
#define SEQ_COL_NAME		1
 | 
			
		||||
#define SEQ_COL_LASTVAL		2
 | 
			
		||||
#define SEQ_COL_INCBY		3
 | 
			
		||||
#define SEQ_COL_MAXVALUE	4
 | 
			
		||||
#define SEQ_COL_MINVALUE	5
 | 
			
		||||
#define SEQ_COL_CACHE		6
 | 
			
		||||
#define SEQ_COL_CYCLE		7
 | 
			
		||||
#define SEQ_COL_CALLED		8
 | 
			
		||||
 | 
			
		||||
#define SEQ_COL_FIRSTCOL	SEQ_COL_NAME
 | 
			
		||||
#define SEQ_COL_LASTCOL		SEQ_COL_CALLED
 | 
			
		||||
#define SEQ_COL_NAME			1
 | 
			
		||||
#define SEQ_COL_LASTVAL			2
 | 
			
		||||
#define SEQ_COL_INCBY			3
 | 
			
		||||
#define SEQ_COL_MAXVALUE		4
 | 
			
		||||
#define SEQ_COL_MINVALUE		5
 | 
			
		||||
#define SEQ_COL_CACHE			6
 | 
			
		||||
#define SEQ_COL_CYCLE			7
 | 
			
		||||
#define SEQ_COL_CALLED			8
 | 
			
		||||
 | 
			
		||||
extern void DefineSequence (CreateSeqStmt *stmt);
 | 
			
		||||
extern int4 nextval (struct varlena *seqname);
 | 
			
		||||
extern int4 currval (struct varlena *seqname);
 | 
			
		||||
extern void CloseSequences (void);
 | 
			
		||||
#define SEQ_COL_FIRSTCOL		SEQ_COL_NAME
 | 
			
		||||
#define SEQ_COL_LASTCOL			SEQ_COL_CALLED
 | 
			
		||||
 | 
			
		||||
#endif	/* SEQUENCE_H */
 | 
			
		||||
extern void		DefineSequence(CreateSeqStmt * stmt);
 | 
			
		||||
extern int4		nextval(struct varlena * seqname);
 | 
			
		||||
extern int4		currval(struct varlena * seqname);
 | 
			
		||||
extern void		CloseSequences(void);
 | 
			
		||||
 | 
			
		||||
#endif							/* SEQUENCE_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * trigger.h--
 | 
			
		||||
 *    prototypes for trigger.c.
 | 
			
		||||
 *	  prototypes for trigger.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
@@ -13,59 +13,60 @@
 | 
			
		||||
#include "access/htup.h"
 | 
			
		||||
#include "utils/rel.h"
 | 
			
		||||
 | 
			
		||||
typedef uint32 TriggerEvent;
 | 
			
		||||
typedef uint32	TriggerEvent;
 | 
			
		||||
 | 
			
		||||
typedef struct TriggerData {
 | 
			
		||||
    TriggerEvent	tg_event;
 | 
			
		||||
    Relation		tg_relation;
 | 
			
		||||
    HeapTuple		tg_trigtuple;
 | 
			
		||||
    HeapTuple		tg_newtuple;
 | 
			
		||||
    Trigger		*tg_trigger;
 | 
			
		||||
} TriggerData;
 | 
			
		||||
typedef struct TriggerData
 | 
			
		||||
{
 | 
			
		||||
	TriggerEvent	tg_event;
 | 
			
		||||
	Relation		tg_relation;
 | 
			
		||||
	HeapTuple		tg_trigtuple;
 | 
			
		||||
	HeapTuple		tg_newtuple;
 | 
			
		||||
	Trigger		   *tg_trigger;
 | 
			
		||||
}				TriggerData;
 | 
			
		||||
 | 
			
		||||
extern TriggerData *CurrentTriggerData;
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_EVENT_INSERT		0x00000000  
 | 
			
		||||
#define TRIGGER_EVENT_DELETE		0x00000001   
 | 
			
		||||
#define TRIGGER_EVENT_UPDATE		0x00000002
 | 
			
		||||
#define TRIGGER_EVENT_OPMASK		0x00000003
 | 
			
		||||
#define TRIGGER_EVENT_ROW		0x00000004
 | 
			
		||||
#define TRIGGER_EVENT_BEFORE		0x00000008
 | 
			
		||||
#define TRIGGER_EVENT_INSERT			0x00000000
 | 
			
		||||
#define TRIGGER_EVENT_DELETE			0x00000001
 | 
			
		||||
#define TRIGGER_EVENT_UPDATE			0x00000002
 | 
			
		||||
#define TRIGGER_EVENT_OPMASK			0x00000003
 | 
			
		||||
#define TRIGGER_EVENT_ROW				0x00000004
 | 
			
		||||
#define TRIGGER_EVENT_BEFORE			0x00000008
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_BY_INSERT(event)	\
 | 
			
		||||
	(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
						TRIGGER_EVENT_INSERT)
 | 
			
		||||
		(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
												TRIGGER_EVENT_INSERT)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_BY_DELETE(event)	\
 | 
			
		||||
	(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
						TRIGGER_EVENT_DELETE)
 | 
			
		||||
		(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
												TRIGGER_EVENT_DELETE)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_BY_UPDATE(event)	\
 | 
			
		||||
	(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
						TRIGGER_EVENT_UPDATE)
 | 
			
		||||
		(((TriggerEvent) (event) & TRIGGER_EVENT_OPMASK) == \
 | 
			
		||||
												TRIGGER_EVENT_UPDATE)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_FOR_ROW(event)		\
 | 
			
		||||
	((TriggerEvent) (event) & TRIGGER_EVENT_ROW)
 | 
			
		||||
#define TRIGGER_FIRED_FOR_ROW(event)			\
 | 
			
		||||
		((TriggerEvent) (event) & TRIGGER_EVENT_ROW)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_FOR_STATEMENT(event)	\
 | 
			
		||||
	(!TRIGGER_FIRED_FOR_ROW (event))
 | 
			
		||||
#define TRIGGER_FIRED_FOR_STATEMENT(event)		\
 | 
			
		||||
		(!TRIGGER_FIRED_FOR_ROW (event))
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_BEFORE(event)		\
 | 
			
		||||
	((TriggerEvent) (event) & TRIGGER_EVENT_BEFORE)
 | 
			
		||||
#define TRIGGER_FIRED_BEFORE(event)				\
 | 
			
		||||
		((TriggerEvent) (event) & TRIGGER_EVENT_BEFORE)
 | 
			
		||||
 | 
			
		||||
#define TRIGGER_FIRED_AFTER(event)		\
 | 
			
		||||
	(!TRIGGER_FIRED_BEFORE (event))
 | 
			
		||||
#define TRIGGER_FIRED_AFTER(event)				\
 | 
			
		||||
		(!TRIGGER_FIRED_BEFORE (event))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
extern void CreateTrigger (CreateTrigStmt *stmt);
 | 
			
		||||
extern void DropTrigger (DropTrigStmt *stmt);
 | 
			
		||||
extern void RelationRemoveTriggers (Relation rel);
 | 
			
		||||
extern void		CreateTrigger(CreateTrigStmt * stmt);
 | 
			
		||||
extern void		DropTrigger(DropTrigStmt * stmt);
 | 
			
		||||
extern void		RelationRemoveTriggers(Relation rel);
 | 
			
		||||
 | 
			
		||||
extern HeapTuple ExecBRInsertTriggers (Relation rel, HeapTuple tuple);
 | 
			
		||||
extern void ExecARInsertTriggers (Relation rel, HeapTuple tuple);
 | 
			
		||||
extern bool ExecBRDeleteTriggers (Relation rel, ItemPointer tupleid);
 | 
			
		||||
extern void ExecARDeleteTriggers (Relation rel, ItemPointer tupleid);
 | 
			
		||||
extern HeapTuple ExecBRUpdateTriggers (Relation rel, ItemPointer tupleid, HeapTuple tuple);
 | 
			
		||||
extern void ExecARUpdateTriggers (Relation rel, ItemPointer tupleid, HeapTuple tuple);
 | 
			
		||||
extern HeapTuple ExecBRInsertTriggers(Relation rel, HeapTuple tuple);
 | 
			
		||||
extern void		ExecARInsertTriggers(Relation rel, HeapTuple tuple);
 | 
			
		||||
extern bool		ExecBRDeleteTriggers(Relation rel, ItemPointer tupleid);
 | 
			
		||||
extern void		ExecARDeleteTriggers(Relation rel, ItemPointer tupleid);
 | 
			
		||||
extern HeapTuple ExecBRUpdateTriggers(Relation rel, ItemPointer tupleid, HeapTuple tuple);
 | 
			
		||||
extern void		ExecARUpdateTriggers(Relation rel, ItemPointer tupleid, HeapTuple tuple);
 | 
			
		||||
 | 
			
		||||
#endif	/* TRIGGER_H */
 | 
			
		||||
#endif							/* TRIGGER_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,87 +1,110 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * vacuum.h--
 | 
			
		||||
 *    header file for postgres vacuum cleaner
 | 
			
		||||
 *	  header file for postgres vacuum cleaner
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: vacuum.h,v 1.7 1997/04/23 06:28:48 vadim Exp $
 | 
			
		||||
 * $Id: vacuum.h,v 1.8 1997/09/07 04:57:33 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	VACUUM_H
 | 
			
		||||
#define	VACUUM_H
 | 
			
		||||
#ifndef VACUUM_H
 | 
			
		||||
#define VACUUM_H
 | 
			
		||||
 | 
			
		||||
#include <access/funcindex.h>
 | 
			
		||||
#include <catalog/pg_index.h>
 | 
			
		||||
 | 
			
		||||
typedef struct VAttListData {
 | 
			
		||||
    int			val_dummy;
 | 
			
		||||
    struct VAttListData	*val_next;
 | 
			
		||||
} VAttListData;
 | 
			
		||||
typedef struct VAttListData
 | 
			
		||||
{
 | 
			
		||||
	int				val_dummy;
 | 
			
		||||
	struct VAttListData *val_next;
 | 
			
		||||
}				VAttListData;
 | 
			
		||||
 | 
			
		||||
typedef VAttListData	*VAttList;
 | 
			
		||||
typedef VAttListData *VAttList;
 | 
			
		||||
 | 
			
		||||
typedef struct VPageDescrData {
 | 
			
		||||
    BlockNumber		vpd_blkno;	/* BlockNumber of this Page */
 | 
			
		||||
    Size		vpd_free;	/* FreeSpace on this Page */
 | 
			
		||||
    uint16		vpd_nusd;	/* Number of OffNums used by vacuum */
 | 
			
		||||
    uint16		vpd_noff;	/* Number of OffNums free or to be free */
 | 
			
		||||
    OffsetNumber	vpd_voff[1];	/* Array of its OffNums */
 | 
			
		||||
} VPageDescrData;
 | 
			
		||||
typedef struct VPageDescrData
 | 
			
		||||
{
 | 
			
		||||
	BlockNumber		vpd_blkno;	/* BlockNumber of this Page */
 | 
			
		||||
	Size			vpd_free;	/* FreeSpace on this Page */
 | 
			
		||||
	uint16			vpd_nusd;	/* Number of OffNums used by vacuum */
 | 
			
		||||
	uint16			vpd_noff;	/* Number of OffNums free or to be free */
 | 
			
		||||
	OffsetNumber	vpd_voff[1];/* Array of its OffNums */
 | 
			
		||||
}				VPageDescrData;
 | 
			
		||||
 | 
			
		||||
typedef VPageDescrData	*VPageDescr;
 | 
			
		||||
typedef VPageDescrData *VPageDescr;
 | 
			
		||||
 | 
			
		||||
typedef struct VPageListData {
 | 
			
		||||
    int			vpl_nemend;	/* Number of "empty" end-pages */
 | 
			
		||||
    int			vpl_npages;	/* Number of pages in vpl_pgdesc */
 | 
			
		||||
    VPageDescr		*vpl_pgdesc;	/* Descriptions of pages */
 | 
			
		||||
} VPageListData;
 | 
			
		||||
typedef struct VPageListData
 | 
			
		||||
{
 | 
			
		||||
	int				vpl_nemend; /* Number of "empty" end-pages */
 | 
			
		||||
	int				vpl_npages; /* Number of pages in vpl_pgdesc */
 | 
			
		||||
	VPageDescr	   *vpl_pgdesc; /* Descriptions of pages */
 | 
			
		||||
}				VPageListData;
 | 
			
		||||
 | 
			
		||||
typedef VPageListData	*VPageList;
 | 
			
		||||
typedef VPageListData *VPageList;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    FuncIndexInfo	finfo;
 | 
			
		||||
    FuncIndexInfo	*finfoP;
 | 
			
		||||
    IndexTupleForm	tform;
 | 
			
		||||
    int			natts;
 | 
			
		||||
} IndDesc;
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
	FuncIndexInfo	finfo;
 | 
			
		||||
	FuncIndexInfo  *finfoP;
 | 
			
		||||
	IndexTupleForm	tform;
 | 
			
		||||
	int				natts;
 | 
			
		||||
}				IndDesc;
 | 
			
		||||
 | 
			
		||||
typedef struct {
 | 
			
		||||
    AttributeTupleForm attr;
 | 
			
		||||
    Datum best, guess1, guess2, max, min;
 | 
			
		||||
    int16 best_len, guess1_len, guess2_len, max_len, min_len;
 | 
			
		||||
    int32 best_cnt, guess1_cnt, guess1_hits, guess2_hits, null_cnt,nonnull_cnt;
 | 
			
		||||
    int32 max_cnt, min_cnt;
 | 
			
		||||
    func_ptr f_cmpeq, f_cmplt, f_cmpgt;
 | 
			
		||||
    regproc outfunc;
 | 
			
		||||
    bool initialized;
 | 
			
		||||
} VacAttrStats;
 | 
			
		||||
typedef struct
 | 
			
		||||
{
 | 
			
		||||
	AttributeTupleForm attr;
 | 
			
		||||
	Datum			best,
 | 
			
		||||
					guess1,
 | 
			
		||||
					guess2,
 | 
			
		||||
					max,
 | 
			
		||||
					min;
 | 
			
		||||
	int16			best_len,
 | 
			
		||||
					guess1_len,
 | 
			
		||||
					guess2_len,
 | 
			
		||||
					max_len,
 | 
			
		||||
					min_len;
 | 
			
		||||
	int32			best_cnt,
 | 
			
		||||
					guess1_cnt,
 | 
			
		||||
					guess1_hits,
 | 
			
		||||
					guess2_hits,
 | 
			
		||||
					null_cnt,
 | 
			
		||||
					nonnull_cnt;
 | 
			
		||||
	int32			max_cnt,
 | 
			
		||||
					min_cnt;
 | 
			
		||||
	func_ptr		f_cmpeq,
 | 
			
		||||
					f_cmplt,
 | 
			
		||||
					f_cmpgt;
 | 
			
		||||
	regproc			outfunc;
 | 
			
		||||
	bool			initialized;
 | 
			
		||||
}				VacAttrStats;
 | 
			
		||||
 | 
			
		||||
typedef struct VRelListData {
 | 
			
		||||
    Oid			vrl_relid;
 | 
			
		||||
    struct VRelListData	*vrl_next;
 | 
			
		||||
} VRelListData;
 | 
			
		||||
typedef struct VRelListData
 | 
			
		||||
{
 | 
			
		||||
	Oid				vrl_relid;
 | 
			
		||||
	struct VRelListData *vrl_next;
 | 
			
		||||
}				VRelListData;
 | 
			
		||||
 | 
			
		||||
typedef VRelListData	*VRelList;
 | 
			
		||||
typedef VRelListData *VRelList;
 | 
			
		||||
 | 
			
		||||
typedef struct VRelStats {
 | 
			
		||||
    Oid			relid;
 | 
			
		||||
    int			ntups;
 | 
			
		||||
    int			npages;
 | 
			
		||||
    Size		min_tlen;
 | 
			
		||||
    Size		max_tlen;
 | 
			
		||||
    bool		hasindex;
 | 
			
		||||
    int			va_natts;	/* number of attrs being analyzed */
 | 
			
		||||
    VacAttrStats	*vacattrstats;
 | 
			
		||||
} VRelStats;
 | 
			
		||||
typedef struct VRelStats
 | 
			
		||||
{
 | 
			
		||||
	Oid				relid;
 | 
			
		||||
	int				ntups;
 | 
			
		||||
	int				npages;
 | 
			
		||||
	Size			min_tlen;
 | 
			
		||||
	Size			max_tlen;
 | 
			
		||||
	bool			hasindex;
 | 
			
		||||
	int				va_natts;	/* number of attrs being analyzed */
 | 
			
		||||
	VacAttrStats   *vacattrstats;
 | 
			
		||||
}				VRelStats;
 | 
			
		||||
 | 
			
		||||
extern bool VacuumRunning;
 | 
			
		||||
extern bool		VacuumRunning;
 | 
			
		||||
 | 
			
		||||
extern void vc_abort(void);
 | 
			
		||||
extern void vacuum(char *vacrel, bool verbose, bool analyze, List *va_spec);
 | 
			
		||||
extern void		vc_abort(void);
 | 
			
		||||
extern void		vacuum(char *vacrel, bool verbose, bool analyze, List * va_spec);
 | 
			
		||||
 | 
			
		||||
#define ATTNVALS_SCALE 	1000000000 /* XXX so it can act as a float4 */
 | 
			
		||||
#define ATTNVALS_SCALE	1000000000		/* XXX so it can act as a float4 */
 | 
			
		||||
 | 
			
		||||
#endif	/* VACUUM_H */
 | 
			
		||||
#endif							/* VACUUM_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,16 +1,16 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * version.h--
 | 
			
		||||
 *    Header file for versions.  
 | 
			
		||||
 *	  Header file for versions.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: version.h,v 1.4 1997/08/19 21:38:10 momjian Exp $
 | 
			
		||||
 * $Id: version.h,v 1.5 1997/09/07 04:57:35 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef VERSION_H
 | 
			
		||||
#define VERSION_H
 | 
			
		||||
    
 | 
			
		||||
#endif	/* VERSION_H */
 | 
			
		||||
 | 
			
		||||
#endif							/* VERSION_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +1,20 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * view.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: view.h,v 1.1 1996/08/28 07:21:54 scrappy Exp $
 | 
			
		||||
 * $Id: view.h,v 1.2 1997/09/07 04:57:40 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	VIEW_H
 | 
			
		||||
#define	VIEW_H
 | 
			
		||||
#ifndef VIEW_H
 | 
			
		||||
#define VIEW_H
 | 
			
		||||
 | 
			
		||||
extern char *MakeRetrieveViewRuleName(char *view_name);
 | 
			
		||||
extern void DefineView(char *view_name, Query *view_parse);
 | 
			
		||||
extern void RemoveView(char *view_name);
 | 
			
		||||
extern char    *MakeRetrieveViewRuleName(char *view_name);
 | 
			
		||||
extern void		DefineView(char *view_name, Query * view_parse);
 | 
			
		||||
extern void		RemoveView(char *view_name);
 | 
			
		||||
 | 
			
		||||
#endif	/* VIEW_H */
 | 
			
		||||
#endif							/* VIEW_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * execFlatten.h--
 | 
			
		||||
 *    prototypes for execFlatten.c.
 | 
			
		||||
 *	  prototypes for execFlatten.c.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: execFlatten.h,v 1.2 1997/08/19 21:38:12 momjian Exp $
 | 
			
		||||
 * $Id: execFlatten.h,v 1.3 1997/09/07 04:57:41 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef EXECFLATTEN_H
 | 
			
		||||
#define EXECFLATTEN_H
 | 
			
		||||
 | 
			
		||||
extern Datum ExecEvalIter(Iter *iterNode, ExprContext *econtext, bool *resultIsNull, bool *iterIsDone);
 | 
			
		||||
 | 
			
		||||
extern void ExecEvalFjoin(TargetEntry *tlist, ExprContext *econtext, bool *isNullVect, bool *fj_isDone);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* EXECFLATTEN_H */
 | 
			
		||||
extern Datum	ExecEvalIter(Iter * iterNode, ExprContext * econtext, bool * resultIsNull, bool * iterIsDone);
 | 
			
		||||
 | 
			
		||||
extern void		ExecEvalFjoin(TargetEntry * tlist, ExprContext * econtext, bool * isNullVect, bool * fj_isDone);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif							/* EXECFLATTEN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * execdebug.h--
 | 
			
		||||
 *    #defines governing debugging behaviour in the executor
 | 
			
		||||
 *	  #defines governing debugging behaviour in the executor
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: execdebug.h,v 1.2 1996/11/08 00:46:14 scrappy Exp $
 | 
			
		||||
 * $Id: execdebug.h,v 1.3 1997/09/07 04:57:44 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -16,368 +16,368 @@
 | 
			
		||||
#include "access/printtup.h"
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *	debugging defines.
 | 
			
		||||
 *		debugging defines.
 | 
			
		||||
 *
 | 
			
		||||
 *	If you want certain debugging behaviour, then #define
 | 
			
		||||
 *	the variable to 1, else #undef it. -cim 10/26/89
 | 
			
		||||
 *		If you want certain debugging behaviour, then #define
 | 
			
		||||
 *		the variable to 1, else #undef it. -cim 10/26/89
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_DEBUGSTORETUP is for tuple table debugging - this
 | 
			
		||||
 *	will print a message every time we call ExecStoreTuple.
 | 
			
		||||
 *	-cim 3/20/91
 | 
			
		||||
 *		EXEC_DEBUGSTORETUP is for tuple table debugging - this
 | 
			
		||||
 *		will print a message every time we call ExecStoreTuple.
 | 
			
		||||
 *		-cim 3/20/91
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_DEBUGSTORETUP
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_TUPLECOUNT is a #define which causes the
 | 
			
		||||
 *	executor keep track of tuple counts.  This might be
 | 
			
		||||
 *	causing some problems with the decstation stuff so
 | 
			
		||||
 *	you might want to undefine this if you are doing work
 | 
			
		||||
 *	on the decs  - cim 10/20/89
 | 
			
		||||
 *		EXEC_TUPLECOUNT is a #define which causes the
 | 
			
		||||
 *		executor keep track of tuple counts.  This might be
 | 
			
		||||
 *		causing some problems with the decstation stuff so
 | 
			
		||||
 *		you might want to undefine this if you are doing work
 | 
			
		||||
 *		on the decs  - cim 10/20/89
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_TUPLECOUNT
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_SHOWBUFSTATS controls whether or not buffer statistics
 | 
			
		||||
 *	are shown for each query.  -cim 2/9/89
 | 
			
		||||
 *		EXEC_SHOWBUFSTATS controls whether or not buffer statistics
 | 
			
		||||
 *		are shown for each query.  -cim 2/9/89
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_SHOWBUFSTATS
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_CONTEXTDEBUG turns on the printing of debugging information
 | 
			
		||||
 *	by CXT_printf() calls regarding which memory context is the
 | 
			
		||||
 *	CurrentMemoryContext for palloc() calls.  
 | 
			
		||||
 *		EXEC_CONTEXTDEBUG turns on the printing of debugging information
 | 
			
		||||
 *		by CXT_printf() calls regarding which memory context is the
 | 
			
		||||
 *		CurrentMemoryContext for palloc() calls.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_CONTEXTDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_RETURNSIZE is a compile flag governing the
 | 
			
		||||
 *	behaviour of lispFmgr..  See ExecMakeFunctionResult().
 | 
			
		||||
 *	Undefining this avoids a problem in the system cache.
 | 
			
		||||
 *		EXEC_RETURNSIZE is a compile flag governing the
 | 
			
		||||
 *		behaviour of lispFmgr..  See ExecMakeFunctionResult().
 | 
			
		||||
 *		Undefining this avoids a problem in the system cache.
 | 
			
		||||
 *
 | 
			
		||||
 *	Note: undefining this means that there is incorrect
 | 
			
		||||
 *	      information in the const nodes corresponding
 | 
			
		||||
 *	      to function (or operator) results.  The thing is,
 | 
			
		||||
 *	      99% of the time this is fine because when you do
 | 
			
		||||
 *	      something like x = emp.sal + 1, you already know
 | 
			
		||||
 *	      the type and size of x so the fact that + didn't
 | 
			
		||||
 *	      return the correct size doesn't matter.
 | 
			
		||||
 *	      With variable length stuff the size is stored in
 | 
			
		||||
 *	      the first few bytes of the data so again, it's
 | 
			
		||||
 *	      not likely to matter.
 | 
			
		||||
 *		Note: undefining this means that there is incorrect
 | 
			
		||||
 *			  information in the const nodes corresponding
 | 
			
		||||
 *			  to function (or operator) results.  The thing is,
 | 
			
		||||
 *			  99% of the time this is fine because when you do
 | 
			
		||||
 *			  something like x = emp.sal + 1, you already know
 | 
			
		||||
 *			  the type and size of x so the fact that + didn't
 | 
			
		||||
 *			  return the correct size doesn't matter.
 | 
			
		||||
 *			  With variable length stuff the size is stored in
 | 
			
		||||
 *			  the first few bytes of the data so again, it's
 | 
			
		||||
 *			  not likely to matter.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_RETURNSIZE
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_UTILSDEBUG is a flag which turns on debugging of the
 | 
			
		||||
 *	executor utilities by EU_printf() in eutils.c
 | 
			
		||||
 *		EXEC_UTILSDEBUG is a flag which turns on debugging of the
 | 
			
		||||
 *		executor utilities by EU_printf() in eutils.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_UTILSDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the
 | 
			
		||||
 *	nest loop node by NL_printf() and ENL_printf() in nestloop.c
 | 
			
		||||
 *		EXEC_NESTLOOPDEBUG is a flag which turns on debugging of the
 | 
			
		||||
 *		nest loop node by NL_printf() and ENL_printf() in nestloop.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_NESTLOOPDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_PROCDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *	ExecProcNode() by PN_printf() in procnode.c
 | 
			
		||||
 *		EXEC_PROCDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *		ExecProcNode() by PN_printf() in procnode.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_PROCDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_EVALDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *	ExecEval and ExecTargetList() stuff by EV_printf() in qual.c
 | 
			
		||||
 *		EXEC_EVALDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *		ExecEval and ExecTargetList() stuff by EV_printf() in qual.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_EVALDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_SCANDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *	the ExecSeqScan() stuff by S_printf() in seqscan.c
 | 
			
		||||
 *		EXEC_SCANDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *		the ExecSeqScan() stuff by S_printf() in seqscan.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_SCANDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_SORTDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *	the ExecSort() stuff by SO_printf() in sort.c
 | 
			
		||||
 *		EXEC_SORTDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *		the ExecSort() stuff by SO_printf() in sort.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_SORTDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_MERGEJOINDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *	the ExecMergeJoin() stuff by MJ_printf() in mergejoin.c
 | 
			
		||||
 *		EXEC_MERGEJOINDEBUG is a flag which turns on debugging of
 | 
			
		||||
 *		the ExecMergeJoin() stuff by MJ_printf() in mergejoin.c
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_MERGEJOINDEBUG
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_MERGEJOINPFREE is a flag which causes merge joins
 | 
			
		||||
 *	to pfree intermittant tuples (which is the proper thing)
 | 
			
		||||
 *	Not defining this means we avoid menory management problems
 | 
			
		||||
 *	at the cost of doing deallocation of stuff only at the
 | 
			
		||||
 *	end of the transaction
 | 
			
		||||
 *		EXEC_MERGEJOINPFREE is a flag which causes merge joins
 | 
			
		||||
 *		to pfree intermittant tuples (which is the proper thing)
 | 
			
		||||
 *		Not defining this means we avoid menory management problems
 | 
			
		||||
 *		at the cost of doing deallocation of stuff only at the
 | 
			
		||||
 *		end of the transaction
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_MERGEJOINPFREE
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_DEBUGINTERACTIVE is a flag which enables the
 | 
			
		||||
 *	user to issue "DEBUG" commands from an interactive
 | 
			
		||||
 *	backend. 
 | 
			
		||||
 *		EXEC_DEBUGINTERACTIVE is a flag which enables the
 | 
			
		||||
 *		user to issue "DEBUG" commands from an interactive
 | 
			
		||||
 *		backend.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_DEBUGINTERACTIVE
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	EXEC_DEBUGVARIABLEFILE is string, which if defined will
 | 
			
		||||
 *	be loaded when the executor is initialized.  If this
 | 
			
		||||
 *	string is not defined then nothing will be loaded..
 | 
			
		||||
 *		EXEC_DEBUGVARIABLEFILE is string, which if defined will
 | 
			
		||||
 *		be loaded when the executor is initialized.  If this
 | 
			
		||||
 *		string is not defined then nothing will be loaded..
 | 
			
		||||
 *
 | 
			
		||||
 *	Example:
 | 
			
		||||
 *		Example:
 | 
			
		||||
 *
 | 
			
		||||
 * #define EXEC_DEBUGVARIABLEFILE "/a/postgres/cimarron/.pg_debugvars"
 | 
			
		||||
 #
 | 
			
		||||
 *	Note: since these variables are read at execution time,
 | 
			
		||||
 *	they can't affect the first query.. this hack should be
 | 
			
		||||
 *	replaced by something better sometime. -cim 11/2/89
 | 
			
		||||
 *		Note: since these variables are read at execution time,
 | 
			
		||||
 *		they can't affect the first query.. this hack should be
 | 
			
		||||
 *		replaced by something better sometime. -cim 11/2/89
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef EXEC_DEBUGVARIABLEFILE
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *	#defines controlled by above definitions
 | 
			
		||||
 *		#defines controlled by above definitions
 | 
			
		||||
 *
 | 
			
		||||
 *	Note: most of these are "incomplete" because I didn't
 | 
			
		||||
 *	      need the ones not defined.  More should be added
 | 
			
		||||
 *	      only as necessary -cim 10/26/89
 | 
			
		||||
 *		Note: most of these are "incomplete" because I didn't
 | 
			
		||||
 *			  need the ones not defined.  More should be added
 | 
			
		||||
 *			  only as necessary -cim 10/26/89
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#define T_OR_F(b)  		(b ? "true" : "false")
 | 
			
		||||
#define NULL_OR_TUPLE(slot) 	(TupIsNull(slot) ? "null" : "a tuple")
 | 
			
		||||
#define T_OR_F(b)				(b ? "true" : "false")
 | 
			
		||||
#define NULL_OR_TUPLE(slot)		(TupIsNull(slot) ? "null" : "a tuple")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* #define EXEC_TUPLECOUNT - XXX take out for now for executor stubbing -- jolly*/
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	tuple count debugging defines
 | 
			
		||||
 *		tuple count debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_TUPLECOUNT
 | 
			
		||||
extern int     NTupleProcessed;
 | 
			
		||||
extern int     NTupleRetrieved;
 | 
			
		||||
extern int     NTupleReplaced;
 | 
			
		||||
extern int     NTupleAppended;
 | 
			
		||||
extern int     NTupleDeleted;
 | 
			
		||||
extern int     NIndexTupleProcessed;
 | 
			
		||||
extern int     NIndexTupleInserted;
 | 
			
		||||
extern int		NTupleProcessed;
 | 
			
		||||
extern int		NTupleRetrieved;
 | 
			
		||||
extern int		NTupleReplaced;
 | 
			
		||||
extern int		NTupleAppended;
 | 
			
		||||
extern int		NTupleDeleted;
 | 
			
		||||
extern int		NIndexTupleProcessed;
 | 
			
		||||
extern int		NIndexTupleInserted;
 | 
			
		||||
 | 
			
		||||
#define IncrRetrieved()		NTupleRetrieved++
 | 
			
		||||
#define	IncrAppended()		NTupleAppended++
 | 
			
		||||
#define	IncrDeleted()		NTupleDeleted++
 | 
			
		||||
#define	IncrReplaced()		NTupleReplaced++
 | 
			
		||||
#define	IncrInserted()		NTupleInserted++
 | 
			
		||||
#define IncrProcessed()		NTupleProcessed++
 | 
			
		||||
#define IncrRetrieved()			NTupleRetrieved++
 | 
			
		||||
#define IncrAppended()			NTupleAppended++
 | 
			
		||||
#define IncrDeleted()			NTupleDeleted++
 | 
			
		||||
#define IncrReplaced()			NTupleReplaced++
 | 
			
		||||
#define IncrInserted()			NTupleInserted++
 | 
			
		||||
#define IncrProcessed()			NTupleProcessed++
 | 
			
		||||
#define IncrIndexProcessed()	NIndexTupleProcessed++
 | 
			
		||||
#define IncrIndexInserted()	NIndexTupleInserted++
 | 
			
		||||
#define IncrIndexInserted()		NIndexTupleInserted++
 | 
			
		||||
#else
 | 
			
		||||
#define IncrRetrieved()
 | 
			
		||||
#define	IncrAppended()
 | 
			
		||||
#define	IncrDeleted()
 | 
			
		||||
#define	IncrReplaced()
 | 
			
		||||
#define	IncrInserted()
 | 
			
		||||
#define IncrAppended()
 | 
			
		||||
#define IncrDeleted()
 | 
			
		||||
#define IncrReplaced()
 | 
			
		||||
#define IncrInserted()
 | 
			
		||||
#define IncrProcessed()
 | 
			
		||||
#define IncrIndexProcessed()
 | 
			
		||||
#define IncrIndexInserted()
 | 
			
		||||
#endif /* EXEC_TUPLECOUNT */
 | 
			
		||||
#endif							/* EXEC_TUPLECOUNT */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	memory context debugging defines
 | 
			
		||||
 *		memory context debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_CONTEXTDEBUG
 | 
			
		||||
#define CXT_printf(s)			printf(s)
 | 
			
		||||
#define CXT1_printf(s, a)		printf(s, a)
 | 
			
		||||
#define CXT_printf(s)					printf(s)
 | 
			
		||||
#define CXT1_printf(s, a)				printf(s, a)
 | 
			
		||||
#else
 | 
			
		||||
#define CXT_printf(s)		
 | 
			
		||||
#define CXT1_printf(s, a)		
 | 
			
		||||
#endif /* EXEC_CONTEXTDEBUG */
 | 
			
		||||
#define CXT_printf(s)
 | 
			
		||||
#define CXT1_printf(s, a)
 | 
			
		||||
#endif							/* EXEC_CONTEXTDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	eutils debugging defines
 | 
			
		||||
 *		eutils debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_UTILSDEBUG
 | 
			
		||||
#define EU_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define EU_printf(s)			printf(s)
 | 
			
		||||
#define EU1_printf(s, a)		printf(s, a)
 | 
			
		||||
#define EU2_printf(s, a)		printf(s, a, b)
 | 
			
		||||
#define EU3_printf(s, a)		printf(s, a, b, c)
 | 
			
		||||
#define EU4_printf(s, a, b, c, d)	printf(s, a, b, c, d)
 | 
			
		||||
#define EU_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define EU_printf(s)					printf(s)
 | 
			
		||||
#define EU1_printf(s, a)				printf(s, a)
 | 
			
		||||
#define EU2_printf(s, a)				printf(s, a, b)
 | 
			
		||||
#define EU3_printf(s, a)				printf(s, a, b, c)
 | 
			
		||||
#define EU4_printf(s, a, b, c, d)		printf(s, a, b, c, d)
 | 
			
		||||
#else
 | 
			
		||||
#define EU_nodeDisplay(l)		
 | 
			
		||||
#define EU_printf(s)			
 | 
			
		||||
#define EU1_printf(s, a)		
 | 
			
		||||
#define EU_nodeDisplay(l)
 | 
			
		||||
#define EU_printf(s)
 | 
			
		||||
#define EU1_printf(s, a)
 | 
			
		||||
#define EU2_printf(s, a, b)
 | 
			
		||||
#define EU3_printf(s, a, b, c)
 | 
			
		||||
#define EU4_printf(s, a, b, c, d)	
 | 
			
		||||
#endif /* EXEC_UTILSDEBUG */
 | 
			
		||||
#define EU4_printf(s, a, b, c, d)
 | 
			
		||||
#endif							/* EXEC_UTILSDEBUG */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	nest loop debugging defines
 | 
			
		||||
 *		nest loop debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_NESTLOOPDEBUG
 | 
			
		||||
#define NL_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define NL_printf(s)			printf(s)
 | 
			
		||||
#define NL1_printf(s, a)		printf(s, a)
 | 
			
		||||
#define NL4_printf(s, a, b, c, d)	printf(s, a, b, c, d)
 | 
			
		||||
#define ENL1_printf(message)		printf("ExecNestLoop: %s\n", message)
 | 
			
		||||
#define NL_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define NL_printf(s)					printf(s)
 | 
			
		||||
#define NL1_printf(s, a)				printf(s, a)
 | 
			
		||||
#define NL4_printf(s, a, b, c, d)		printf(s, a, b, c, d)
 | 
			
		||||
#define ENL1_printf(message)			printf("ExecNestLoop: %s\n", message)
 | 
			
		||||
#else
 | 
			
		||||
#define NL_nodeDisplay(l)		
 | 
			
		||||
#define NL_printf(s)			
 | 
			
		||||
#define NL1_printf(s, a)		
 | 
			
		||||
#define NL4_printf(s, a, b, c, d)	
 | 
			
		||||
#define NL_nodeDisplay(l)
 | 
			
		||||
#define NL_printf(s)
 | 
			
		||||
#define NL1_printf(s, a)
 | 
			
		||||
#define NL4_printf(s, a, b, c, d)
 | 
			
		||||
#define ENL1_printf(message)
 | 
			
		||||
#endif /* EXEC_NESTLOOPDEBUG */
 | 
			
		||||
#endif							/* EXEC_NESTLOOPDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	proc node debugging defines
 | 
			
		||||
 *		proc node debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_PROCDEBUG
 | 
			
		||||
#define PN_printf(s)			printf(s)
 | 
			
		||||
#define PN1_printf(s, p)		printf(s, p)
 | 
			
		||||
#define PN_printf(s)					printf(s)
 | 
			
		||||
#define PN1_printf(s, p)				printf(s, p)
 | 
			
		||||
#else
 | 
			
		||||
#define PN_printf(s)		
 | 
			
		||||
#define PN1_printf(s, p)	
 | 
			
		||||
#endif /* EXEC_PROCDEBUG */
 | 
			
		||||
#define PN_printf(s)
 | 
			
		||||
#define PN1_printf(s, p)
 | 
			
		||||
#endif							/* EXEC_PROCDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	exec eval / target list debugging defines
 | 
			
		||||
 *		exec eval / target list debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_EVALDEBUG
 | 
			
		||||
#define EV_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define EV_printf(s)			printf(s)
 | 
			
		||||
#define EV1_printf(s, a)		printf(s, a)
 | 
			
		||||
#define EV_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define EV_printf(s)					printf(s)
 | 
			
		||||
#define EV1_printf(s, a)				printf(s, a)
 | 
			
		||||
#define EV5_printf(s, a, b, c, d, e)	printf(s, a, b, c, d, e)
 | 
			
		||||
#else
 | 
			
		||||
#define EV_nodeDisplay(l)		
 | 
			
		||||
#define EV_printf(s)			
 | 
			
		||||
#define EV1_printf(s, a)		
 | 
			
		||||
#define EV5_printf(s, a, b, c, d, e)	
 | 
			
		||||
#endif /* EXEC_EVALDEBUG */
 | 
			
		||||
#define EV_nodeDisplay(l)
 | 
			
		||||
#define EV_printf(s)
 | 
			
		||||
#define EV1_printf(s, a)
 | 
			
		||||
#define EV5_printf(s, a, b, c, d, e)
 | 
			
		||||
#endif							/* EXEC_EVALDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	scan debugging defines
 | 
			
		||||
 *		scan debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_SCANDEBUG
 | 
			
		||||
#define S_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define S_printf(s)			printf(s)
 | 
			
		||||
#define S1_printf(s, p)			printf(s, p)
 | 
			
		||||
#define S_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define S_printf(s)						printf(s)
 | 
			
		||||
#define S1_printf(s, p)					printf(s, p)
 | 
			
		||||
#else
 | 
			
		||||
#define S_nodeDisplay(l)	
 | 
			
		||||
#define S_printf(s)		
 | 
			
		||||
#define S1_printf(s, p)		
 | 
			
		||||
#endif /*  EXEC_SCANDEBUG */
 | 
			
		||||
 
 | 
			
		||||
#define S_nodeDisplay(l)
 | 
			
		||||
#define S_printf(s)
 | 
			
		||||
#define S1_printf(s, p)
 | 
			
		||||
#endif							/* EXEC_SCANDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	sort node debugging defines
 | 
			
		||||
 *		sort node debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_SORTDEBUG
 | 
			
		||||
#define SO_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define SO_printf(s)			printf(s)
 | 
			
		||||
#define SO1_printf(s, p)		printf(s, p)
 | 
			
		||||
#define SO_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define SO_printf(s)					printf(s)
 | 
			
		||||
#define SO1_printf(s, p)				printf(s, p)
 | 
			
		||||
#else
 | 
			
		||||
#define SO_nodeDisplay(l)	
 | 
			
		||||
#define SO_printf(s)		
 | 
			
		||||
#define SO1_printf(s, p)		
 | 
			
		||||
#endif /* EXEC_SORTDEBUG */
 | 
			
		||||
#define SO_nodeDisplay(l)
 | 
			
		||||
#define SO_printf(s)
 | 
			
		||||
#define SO1_printf(s, p)
 | 
			
		||||
#endif							/* EXEC_SORTDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	merge join debugging defines
 | 
			
		||||
 *		merge join debugging defines
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#ifdef EXEC_MERGEJOINDEBUG
 | 
			
		||||
#define MJ_nodeDisplay(l)		nodeDisplay(l, 0)
 | 
			
		||||
#define MJ_printf(s)			printf(s)
 | 
			
		||||
#define MJ1_printf(s, p)		printf(s, p)
 | 
			
		||||
#define MJ2_printf(s, p1, p2)		printf(s, p1, p2)
 | 
			
		||||
#define MJ_debugtup(tuple, type)	debugtup(tuple, type)
 | 
			
		||||
#define MJ_dump(context, state)		ExecMergeTupleDump(econtext, state)
 | 
			
		||||
#define MJ_nodeDisplay(l)				nodeDisplay(l, 0)
 | 
			
		||||
#define MJ_printf(s)					printf(s)
 | 
			
		||||
#define MJ1_printf(s, p)				printf(s, p)
 | 
			
		||||
#define MJ2_printf(s, p1, p2)			printf(s, p1, p2)
 | 
			
		||||
#define MJ_debugtup(tuple, type)		debugtup(tuple, type)
 | 
			
		||||
#define MJ_dump(context, state)			ExecMergeTupleDump(econtext, state)
 | 
			
		||||
#define MJ_DEBUG_QUAL(clause, res) \
 | 
			
		||||
  MJ2_printf("  ExecQual(%s, econtext) returns %s\n", \
 | 
			
		||||
	     CppAsString(clause), T_OR_F(res));
 | 
			
		||||
	    
 | 
			
		||||
			 CppAsString(clause), T_OR_F(res));
 | 
			
		||||
 | 
			
		||||
#define MJ_DEBUG_MERGE_COMPARE(qual, res) \
 | 
			
		||||
  MJ2_printf("  MergeCompare(mergeclauses, %s, ..) returns %s\n", \
 | 
			
		||||
	     CppAsString(qual), T_OR_F(res));
 | 
			
		||||
			 CppAsString(qual), T_OR_F(res));
 | 
			
		||||
 | 
			
		||||
#define MJ_DEBUG_PROC_NODE(slot) \
 | 
			
		||||
  MJ2_printf("  %s = ExecProcNode(innerPlan) returns %s\n", \
 | 
			
		||||
	     CppAsString(slot), NULL_OR_TUPLE(slot));
 | 
			
		||||
			 CppAsString(slot), NULL_OR_TUPLE(slot));
 | 
			
		||||
#else
 | 
			
		||||
#define MJ_nodeDisplay(l)
 | 
			
		||||
#define MJ_printf(s)		
 | 
			
		||||
#define MJ1_printf(s, p)		
 | 
			
		||||
#define MJ_printf(s)
 | 
			
		||||
#define MJ1_printf(s, p)
 | 
			
		||||
#define MJ2_printf(s, p1, p2)
 | 
			
		||||
#define MJ_debugtup(tuple, type)
 | 
			
		||||
#define MJ_dump(context, state)
 | 
			
		||||
#define MJ_DEBUG_QUAL(clause, res)
 | 
			
		||||
#define MJ_DEBUG_MERGE_COMPARE(qual, res)
 | 
			
		||||
#define MJ_DEBUG_PROC_NODE(slot)
 | 
			
		||||
#endif /* EXEC_MERGEJOINDEBUG */
 | 
			
		||||
#endif							/* EXEC_MERGEJOINDEBUG */
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *	DO NOT DEFINE THESE EVER OR YOU WILL BURN!
 | 
			
		||||
 *		DO NOT DEFINE THESE EVER OR YOU WILL BURN!
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	DOESNOTWORK is currently placed around memory manager
 | 
			
		||||
 *	code that is known to cause problems.  Code in between
 | 
			
		||||
 *	is likely not converted and probably won't work anyways.
 | 
			
		||||
 *		DOESNOTWORK is currently placed around memory manager
 | 
			
		||||
 *		code that is known to cause problems.  Code in between
 | 
			
		||||
 *		is likely not converted and probably won't work anyways.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef DOESNOTWORK
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	PERHAPSNEVER is placed around the "scan attribute"
 | 
			
		||||
 *	support code for the rule manager because for now we
 | 
			
		||||
 *	do things inefficiently.  The correct solution to our
 | 
			
		||||
 *	problem is to add code to the parser/planner to save
 | 
			
		||||
 *	attribute information for the rule manager rather than
 | 
			
		||||
 *	have the executor have to grope through the entire plan
 | 
			
		||||
 *	for it so if we ever decide to make things better,
 | 
			
		||||
 *	we should probably delete the stuff in between PERHAPSNEVER..
 | 
			
		||||
 *		PERHAPSNEVER is placed around the "scan attribute"
 | 
			
		||||
 *		support code for the rule manager because for now we
 | 
			
		||||
 *		do things inefficiently.  The correct solution to our
 | 
			
		||||
 *		problem is to add code to the parser/planner to save
 | 
			
		||||
 *		attribute information for the rule manager rather than
 | 
			
		||||
 *		have the executor have to grope through the entire plan
 | 
			
		||||
 *		for it so if we ever decide to make things better,
 | 
			
		||||
 *		we should probably delete the stuff in between PERHAPSNEVER..
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef PERHAPSNEVER
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	NOTYET is placed around any code not yet implemented
 | 
			
		||||
 *	in the executor.  Only remove these when actually implementing
 | 
			
		||||
 *	said code.
 | 
			
		||||
 *		NOTYET is placed around any code not yet implemented
 | 
			
		||||
 *		in the executor.  Only remove these when actually implementing
 | 
			
		||||
 *		said code.
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#undef NOTYET
 | 
			
		||||
 | 
			
		||||
extern long NDirectFileRead;
 | 
			
		||||
extern long NDirectFileWrite;
 | 
			
		||||
extern long		NDirectFileRead;
 | 
			
		||||
extern long		NDirectFileWrite;
 | 
			
		||||
 | 
			
		||||
#endif /*  ExecDebugIncluded */
 | 
			
		||||
#endif							/* ExecDebugIncluded */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * execdefs.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: execdefs.h,v 1.1 1996/08/28 07:22:07 scrappy Exp $
 | 
			
		||||
 * $Id: execdefs.h,v 1.2 1997/09/07 04:57:46 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -14,34 +14,34 @@
 | 
			
		||||
#define EXECDEFS_H
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	ExecutePlan() tuplecount definitions
 | 
			
		||||
 *		ExecutePlan() tuplecount definitions
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define ALL_TUPLES		0		/* return all tuples */
 | 
			
		||||
#define ONE_TUPLE		1		/* return only one tuple */
 | 
			
		||||
#define ALL_TUPLES				0		/* return all tuples */
 | 
			
		||||
#define ONE_TUPLE				1		/* return only one tuple */
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	constants used by ExecMain
 | 
			
		||||
 *		constants used by ExecMain
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define EXEC_RUN		        3
 | 
			
		||||
#define EXEC_FOR 			4
 | 
			
		||||
#define EXEC_BACK			5
 | 
			
		||||
#define EXEC_RETONE  			6
 | 
			
		||||
#define EXEC_RESULT  			7
 | 
			
		||||
#define EXEC_RUN						3
 | 
			
		||||
#define EXEC_FOR						4
 | 
			
		||||
#define EXEC_BACK						5
 | 
			
		||||
#define EXEC_RETONE						6
 | 
			
		||||
#define EXEC_RESULT						7
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	Merge Join states
 | 
			
		||||
 *		Merge Join states
 | 
			
		||||
 * ----------------
 | 
			
		||||
 */
 | 
			
		||||
#define EXEC_MJ_INITIALIZE		1
 | 
			
		||||
#define EXEC_MJ_JOINMARK		2
 | 
			
		||||
#define EXEC_MJ_JOINTEST		3
 | 
			
		||||
#define EXEC_MJ_JOINTUPLES		4
 | 
			
		||||
#define EXEC_MJ_NEXTOUTER		5
 | 
			
		||||
#define EXEC_MJ_TESTOUTER		6
 | 
			
		||||
#define EXEC_MJ_NEXTINNER		7
 | 
			
		||||
#define EXEC_MJ_SKIPINNER		8
 | 
			
		||||
#define EXEC_MJ_SKIPOUTER		9
 | 
			
		||||
#define EXEC_MJ_INITIALIZE				1
 | 
			
		||||
#define EXEC_MJ_JOINMARK				2
 | 
			
		||||
#define EXEC_MJ_JOINTEST				3
 | 
			
		||||
#define EXEC_MJ_JOINTUPLES				4
 | 
			
		||||
#define EXEC_MJ_NEXTOUTER				5
 | 
			
		||||
#define EXEC_MJ_TESTOUTER				6
 | 
			
		||||
#define EXEC_MJ_NEXTINNER				7
 | 
			
		||||
#define EXEC_MJ_SKIPINNER				8
 | 
			
		||||
#define EXEC_MJ_SKIPOUTER				9
 | 
			
		||||
 | 
			
		||||
#endif /* EXECDEFS_H */
 | 
			
		||||
#endif							/* EXECDEFS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,13 +1,13 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * execdesc.h--
 | 
			
		||||
 *    plan and query descriptor accessor macros used by the executor
 | 
			
		||||
 *    and related modules.
 | 
			
		||||
 *	  plan and query descriptor accessor macros used by the executor
 | 
			
		||||
 *	  and related modules.
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: execdesc.h,v 1.3 1996/11/05 08:18:31 scrappy Exp $
 | 
			
		||||
 * $Id: execdesc.h,v 1.4 1997/09/07 04:57:47 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -19,20 +19,22 @@
 | 
			
		||||
#include <nodes/parsenodes.h>
 | 
			
		||||
 | 
			
		||||
/* ----------------
 | 
			
		||||
 *	query descriptor:
 | 
			
		||||
 *  a QueryDesc encapsulates everything that the executor
 | 
			
		||||
 *  needs to execute the query
 | 
			
		||||
 *		query descriptor:
 | 
			
		||||
 *	a QueryDesc encapsulates everything that the executor
 | 
			
		||||
 *	needs to execute the query
 | 
			
		||||
 * ---------------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct QueryDesc {
 | 
			
		||||
    CmdType		operation; /* CMD_SELECT, CMD_UPDATE, etc. */
 | 
			
		||||
    Query		*parsetree; 
 | 
			
		||||
    Plan		*plantree;
 | 
			
		||||
    CommandDest		dest;  /* the destination output of the execution */
 | 
			
		||||
} QueryDesc;
 | 
			
		||||
typedef struct QueryDesc
 | 
			
		||||
{
 | 
			
		||||
	CmdType			operation;	/* CMD_SELECT, CMD_UPDATE, etc. */
 | 
			
		||||
	Query		   *parsetree;
 | 
			
		||||
	Plan		   *plantree;
 | 
			
		||||
	CommandDest		dest;		/* the destination output of the execution */
 | 
			
		||||
}				QueryDesc;
 | 
			
		||||
 | 
			
		||||
/* in pquery.c */
 | 
			
		||||
extern QueryDesc *CreateQueryDesc(Query *parsetree, Plan *plantree,
 | 
			
		||||
				  CommandDest dest);
 | 
			
		||||
extern QueryDesc *
 | 
			
		||||
CreateQueryDesc(Query * parsetree, Plan * plantree,
 | 
			
		||||
				CommandDest dest);
 | 
			
		||||
 | 
			
		||||
#endif /*  EXECDESC_H  */
 | 
			
		||||
#endif							/* EXECDESC_H  */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,12 +1,12 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * executor.h--
 | 
			
		||||
 *    support for the POSTGRES executor module
 | 
			
		||||
 *	  support for the POSTGRES executor module
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: executor.h,v 1.10 1997/08/22 14:39:33 vadim Exp $
 | 
			
		||||
 * $Id: executor.h,v 1.11 1997/09/07 04:57:47 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
@@ -26,127 +26,146 @@
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execAmi.c
 | 
			
		||||
 */
 | 
			
		||||
extern void ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
 | 
			
		||||
		   ScanDirection dir, TimeQual timeRange,
 | 
			
		||||
		   Relation *returnRelation, Pointer *returnScanDesc);
 | 
			
		||||
extern void ExecCloseR(Plan *node);
 | 
			
		||||
extern void ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent);
 | 
			
		||||
extern HeapScanDesc ExecReScanR(Relation relDesc, HeapScanDesc scanDesc,
 | 
			
		||||
			 ScanDirection direction, int nkeys, ScanKey skeys);
 | 
			
		||||
extern void ExecMarkPos(Plan *node);
 | 
			
		||||
extern void ExecRestrPos(Plan *node);
 | 
			
		||||
extern void
 | 
			
		||||
ExecOpenScanR(Oid relOid, int nkeys, ScanKey skeys, bool isindex,
 | 
			
		||||
			  ScanDirection dir, TimeQual timeRange,
 | 
			
		||||
			  Relation * returnRelation, Pointer * returnScanDesc);
 | 
			
		||||
extern void		ExecCloseR(Plan * node);
 | 
			
		||||
extern void		ExecReScan(Plan * node, ExprContext * exprCtxt, Plan * parent);
 | 
			
		||||
extern HeapScanDesc
 | 
			
		||||
ExecReScanR(Relation relDesc, HeapScanDesc scanDesc,
 | 
			
		||||
			ScanDirection direction, int nkeys, ScanKey skeys);
 | 
			
		||||
extern void		ExecMarkPos(Plan * node);
 | 
			
		||||
extern void		ExecRestrPos(Plan * node);
 | 
			
		||||
extern Relation ExecCreatR(TupleDesc tupType, Oid relationOid);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execJunk.c
 | 
			
		||||
 */
 | 
			
		||||
extern JunkFilter *ExecInitJunkFilter(List *targetList);
 | 
			
		||||
extern bool ExecGetJunkAttribute(JunkFilter *junkfilter, TupleTableSlot *slot,
 | 
			
		||||
				 char *attrName, Datum *value, bool *isNull);
 | 
			
		||||
extern HeapTuple ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot);
 | 
			
		||||
extern JunkFilter *ExecInitJunkFilter(List * targetList);
 | 
			
		||||
extern bool
 | 
			
		||||
ExecGetJunkAttribute(JunkFilter * junkfilter, TupleTableSlot * slot,
 | 
			
		||||
					 char *attrName, Datum * value, bool * isNull);
 | 
			
		||||
extern HeapTuple ExecRemoveJunk(JunkFilter * junkfilter, TupleTableSlot * slot);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execMain.c
 | 
			
		||||
 */
 | 
			
		||||
extern TupleDesc ExecutorStart(QueryDesc *queryDesc, EState *estate);
 | 
			
		||||
extern TupleTableSlot* ExecutorRun(QueryDesc *queryDesc, EState *estate, int feature, int count);
 | 
			
		||||
extern void ExecutorEnd(QueryDesc *queryDesc, EState *estate);
 | 
			
		||||
extern HeapTuple ExecConstraints (char *caller, Relation rel, HeapTuple tuple);
 | 
			
		||||
extern TupleDesc ExecutorStart(QueryDesc * queryDesc, EState * estate);
 | 
			
		||||
extern TupleTableSlot *ExecutorRun(QueryDesc * queryDesc, EState * estate, int feature, int count);
 | 
			
		||||
extern void		ExecutorEnd(QueryDesc * queryDesc, EState * estate);
 | 
			
		||||
extern HeapTuple ExecConstraints(char *caller, Relation rel, HeapTuple tuple);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execProcnode.c
 | 
			
		||||
 */
 | 
			
		||||
extern bool ExecInitNode(Plan *node, EState *estate, Plan *parent);
 | 
			
		||||
extern TupleTableSlot *ExecProcNode(Plan *node, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsNode(Plan *node);
 | 
			
		||||
extern void ExecEndNode(Plan *node, Plan *parent);
 | 
			
		||||
extern bool		ExecInitNode(Plan * node, EState * estate, Plan * parent);
 | 
			
		||||
extern TupleTableSlot *ExecProcNode(Plan * node, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsNode(Plan * node);
 | 
			
		||||
extern void		ExecEndNode(Plan * node, Plan * parent);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execQual.c
 | 
			
		||||
 */
 | 
			
		||||
extern bool execConstByVal;
 | 
			
		||||
extern int 	execConstLen;
 | 
			
		||||
extern bool		execConstByVal;
 | 
			
		||||
extern int		execConstLen;
 | 
			
		||||
 | 
			
		||||
extern Datum
 | 
			
		||||
ExecExtractResult(TupleTableSlot * slot, AttrNumber attnum,
 | 
			
		||||
				  bool * isNull);
 | 
			
		||||
extern Datum
 | 
			
		||||
ExecEvalParam(Param * expression, ExprContext * econtext,
 | 
			
		||||
			  bool * isNull);
 | 
			
		||||
 | 
			
		||||
extern Datum ExecExtractResult(TupleTableSlot *slot, AttrNumber attnum,
 | 
			
		||||
			bool *isNull);
 | 
			
		||||
extern Datum ExecEvalParam(Param *expression, ExprContext *econtext,
 | 
			
		||||
			   bool *isNull);
 | 
			
		||||
/* stop here */
 | 
			
		||||
extern char *GetAttributeByName(TupleTableSlot *slot, char *attname,
 | 
			
		||||
				bool *isNull);
 | 
			
		||||
extern Datum ExecEvalExpr(Node *expression, ExprContext *econtext, bool *isNull,
 | 
			
		||||
			  bool *isDone);
 | 
			
		||||
extern bool ExecQual(List *qual, ExprContext *econtext);
 | 
			
		||||
extern int ExecTargetListLength(List *targetlist);
 | 
			
		||||
extern TupleTableSlot *ExecProject(ProjectionInfo *projInfo, bool *isDone);
 | 
			
		||||
extern char    *
 | 
			
		||||
GetAttributeByName(TupleTableSlot * slot, char *attname,
 | 
			
		||||
				   bool * isNull);
 | 
			
		||||
extern Datum
 | 
			
		||||
ExecEvalExpr(Node * expression, ExprContext * econtext, bool * isNull,
 | 
			
		||||
			 bool * isDone);
 | 
			
		||||
extern bool		ExecQual(List * qual, ExprContext * econtext);
 | 
			
		||||
extern int		ExecTargetListLength(List * targetlist);
 | 
			
		||||
extern TupleTableSlot *ExecProject(ProjectionInfo * projInfo, bool * isDone);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execScan.c
 | 
			
		||||
 */
 | 
			
		||||
extern TupleTableSlot *ExecScan(Scan *node, TupleTableSlot* (*accessMtd)());
 | 
			
		||||
extern TupleTableSlot *ExecScan(Scan * node, TupleTableSlot * (*accessMtd) ());
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execTuples.c
 | 
			
		||||
 */
 | 
			
		||||
extern TupleTable ExecCreateTupleTable(int initialSize);
 | 
			
		||||
extern void ExecDestroyTupleTable(TupleTable table, bool shouldFree);
 | 
			
		||||
extern TupleTableSlot* ExecAllocTableSlot(TupleTable table);
 | 
			
		||||
extern TupleTableSlot* ExecStoreTuple(HeapTuple tuple, 
 | 
			
		||||
				      TupleTableSlot *slot,
 | 
			
		||||
				      Buffer buffer,
 | 
			
		||||
				      bool shouldFree);
 | 
			
		||||
extern TupleTableSlot* ExecClearTuple(TupleTableSlot* slot);
 | 
			
		||||
extern bool ExecSetSlotPolicy(TupleTableSlot *slot, bool shouldFree);
 | 
			
		||||
extern TupleDesc ExecSetSlotDescriptor(TupleTableSlot *slot,
 | 
			
		||||
				       TupleDesc tupdesc);
 | 
			
		||||
extern void ExecSetSlotDescriptorIsNew(TupleTableSlot *slot, bool isNew);
 | 
			
		||||
extern void ExecIncrSlotBufferRefcnt(TupleTableSlot *slot);
 | 
			
		||||
extern bool TupIsNull(TupleTableSlot* slot);
 | 
			
		||||
extern void ExecInitResultTupleSlot(EState *estate, CommonState *commonstate);
 | 
			
		||||
extern void ExecInitScanTupleSlot(EState *estate,
 | 
			
		||||
				  CommonScanState *commonscanstate);
 | 
			
		||||
extern void ExecInitMarkedTupleSlot(EState *estate, MergeJoinState *mergestate);
 | 
			
		||||
extern void ExecInitOuterTupleSlot(EState *estate, HashJoinState *hashstate);
 | 
			
		||||
extern void		ExecDestroyTupleTable(TupleTable table, bool shouldFree);
 | 
			
		||||
extern TupleTableSlot *ExecAllocTableSlot(TupleTable table);
 | 
			
		||||
extern TupleTableSlot *
 | 
			
		||||
ExecStoreTuple(HeapTuple tuple,
 | 
			
		||||
			   TupleTableSlot * slot,
 | 
			
		||||
			   Buffer buffer,
 | 
			
		||||
			   bool shouldFree);
 | 
			
		||||
extern TupleTableSlot *ExecClearTuple(TupleTableSlot * slot);
 | 
			
		||||
extern bool		ExecSetSlotPolicy(TupleTableSlot * slot, bool shouldFree);
 | 
			
		||||
extern TupleDesc
 | 
			
		||||
ExecSetSlotDescriptor(TupleTableSlot * slot,
 | 
			
		||||
					  TupleDesc tupdesc);
 | 
			
		||||
extern void		ExecSetSlotDescriptorIsNew(TupleTableSlot * slot, bool isNew);
 | 
			
		||||
extern void		ExecIncrSlotBufferRefcnt(TupleTableSlot * slot);
 | 
			
		||||
extern bool		TupIsNull(TupleTableSlot * slot);
 | 
			
		||||
extern void		ExecInitResultTupleSlot(EState * estate, CommonState * commonstate);
 | 
			
		||||
extern void
 | 
			
		||||
ExecInitScanTupleSlot(EState * estate,
 | 
			
		||||
					  CommonScanState * commonscanstate);
 | 
			
		||||
extern void		ExecInitMarkedTupleSlot(EState * estate, MergeJoinState * mergestate);
 | 
			
		||||
extern void		ExecInitOuterTupleSlot(EState * estate, HashJoinState * hashstate);
 | 
			
		||||
 | 
			
		||||
extern TupleDesc ExecGetTupType(Plan *node);
 | 
			
		||||
extern TupleDesc ExecTypeFromTL(List *targetList);
 | 
			
		||||
extern TupleDesc ExecGetTupType(Plan * node);
 | 
			
		||||
extern TupleDesc ExecTypeFromTL(List * targetList);
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * prototypes from functions in execTuples.c
 | 
			
		||||
 */
 | 
			
		||||
extern void ResetTupleCount(void);
 | 
			
		||||
extern void ExecAssignNodeBaseInfo(EState *estate, CommonState *basenode,
 | 
			
		||||
				   Plan *parent);
 | 
			
		||||
extern void ExecAssignExprContext(EState *estate, CommonState *commonstate);
 | 
			
		||||
extern void ExecAssignResultType(CommonState *commonstate,
 | 
			
		||||
				 TupleDesc tupDesc);
 | 
			
		||||
extern void ExecAssignResultTypeFromOuterPlan(Plan *node,
 | 
			
		||||
		CommonState *commonstate);
 | 
			
		||||
extern void ExecAssignResultTypeFromTL(Plan *node, CommonState *commonstate);
 | 
			
		||||
extern TupleDesc ExecGetResultType(CommonState *commonstate);
 | 
			
		||||
extern void ExecAssignProjectionInfo(Plan *node, CommonState *commonstate);
 | 
			
		||||
extern void ExecFreeProjectionInfo(CommonState *commonstate);
 | 
			
		||||
extern TupleDesc ExecGetScanType(CommonScanState *csstate);
 | 
			
		||||
extern void ExecAssignScanType(CommonScanState	*csstate,
 | 
			
		||||
			       TupleDesc tupDesc);
 | 
			
		||||
extern void ExecAssignScanTypeFromOuterPlan(Plan *node,
 | 
			
		||||
					    CommonScanState *csstate);
 | 
			
		||||
extern void		ResetTupleCount(void);
 | 
			
		||||
extern void
 | 
			
		||||
ExecAssignNodeBaseInfo(EState * estate, CommonState * basenode,
 | 
			
		||||
					   Plan * parent);
 | 
			
		||||
extern void		ExecAssignExprContext(EState * estate, CommonState * commonstate);
 | 
			
		||||
extern void
 | 
			
		||||
ExecAssignResultType(CommonState * commonstate,
 | 
			
		||||
					 TupleDesc tupDesc);
 | 
			
		||||
extern void
 | 
			
		||||
ExecAssignResultTypeFromOuterPlan(Plan * node,
 | 
			
		||||
								  CommonState * commonstate);
 | 
			
		||||
extern void		ExecAssignResultTypeFromTL(Plan * node, CommonState * commonstate);
 | 
			
		||||
extern TupleDesc ExecGetResultType(CommonState * commonstate);
 | 
			
		||||
extern void		ExecAssignProjectionInfo(Plan * node, CommonState * commonstate);
 | 
			
		||||
extern void		ExecFreeProjectionInfo(CommonState * commonstate);
 | 
			
		||||
extern TupleDesc ExecGetScanType(CommonScanState * csstate);
 | 
			
		||||
extern void
 | 
			
		||||
ExecAssignScanType(CommonScanState * csstate,
 | 
			
		||||
				   TupleDesc tupDesc);
 | 
			
		||||
extern void
 | 
			
		||||
ExecAssignScanTypeFromOuterPlan(Plan * node,
 | 
			
		||||
								CommonScanState * csstate);
 | 
			
		||||
extern AttributeTupleForm ExecGetTypeInfo(Relation relDesc);
 | 
			
		||||
 | 
			
		||||
extern void ExecOpenIndices(Oid resultRelationOid,
 | 
			
		||||
			    RelationInfo *resultRelationInfo);
 | 
			
		||||
extern void ExecCloseIndices(RelationInfo *resultRelationInfo);
 | 
			
		||||
extern void ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid,
 | 
			
		||||
				      EState *estate, bool is_update);
 | 
			
		||||
extern void resetVarAttrLenForCreateTable(TupleDesc tupType);
 | 
			
		||||
extern void setVarAttrLenForCreateTable(TupleDesc tupType,
 | 
			
		||||
			List *targetList, List *rangeTable);
 | 
			
		||||
extern void
 | 
			
		||||
ExecOpenIndices(Oid resultRelationOid,
 | 
			
		||||
				RelationInfo * resultRelationInfo);
 | 
			
		||||
extern void		ExecCloseIndices(RelationInfo * resultRelationInfo);
 | 
			
		||||
extern void
 | 
			
		||||
ExecInsertIndexTuples(TupleTableSlot * slot, ItemPointer tupleid,
 | 
			
		||||
					  EState * estate, bool is_update);
 | 
			
		||||
extern void		resetVarAttrLenForCreateTable(TupleDesc tupType);
 | 
			
		||||
extern void
 | 
			
		||||
setVarAttrLenForCreateTable(TupleDesc tupType,
 | 
			
		||||
							List * targetList, List * rangeTable);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *	the end
 | 
			
		||||
 *		the end
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#endif /*  EXECUTOR_H  */
 | 
			
		||||
#endif							/* EXECUTOR_H  */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,22 +1,24 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * functions.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: functions.h,v 1.1 1996/08/28 07:22:12 scrappy Exp $
 | 
			
		||||
 * $Id: functions.h,v 1.2 1997/09/07 04:57:48 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	FUNCTIONS_H
 | 
			
		||||
#ifndef FUNCTIONS_H
 | 
			
		||||
#define FUNCTIONS_H
 | 
			
		||||
 | 
			
		||||
extern Datum ProjectAttribute(TupleDesc TD, TargetEntry *tlist,
 | 
			
		||||
			      HeapTuple tup, bool *isnullP);
 | 
			
		||||
extern Datum
 | 
			
		||||
ProjectAttribute(TupleDesc TD, TargetEntry * tlist,
 | 
			
		||||
				 HeapTuple tup, bool * isnullP);
 | 
			
		||||
 | 
			
		||||
extern Datum postquel_function(Func *funcNode, char **args,
 | 
			
		||||
			       bool *isNull, bool *isDone);
 | 
			
		||||
extern Datum
 | 
			
		||||
postquel_function(Func * funcNode, char **args,
 | 
			
		||||
				  bool * isNull, bool * isDone);
 | 
			
		||||
 | 
			
		||||
#endif /* FUNCTIONS_H */
 | 
			
		||||
#endif							/* FUNCTIONS_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,81 +1,84 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * hashjoin.h--
 | 
			
		||||
 *    internal structures for hash table and buckets
 | 
			
		||||
 *	  internal structures for hash table and buckets
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: hashjoin.h,v 1.3 1996/11/04 08:52:46 scrappy Exp $
 | 
			
		||||
 * $Id: hashjoin.h,v 1.4 1997/09/07 04:57:49 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	HASHJOIN_H
 | 
			
		||||
#ifndef HASHJOIN_H
 | 
			
		||||
#define HASHJOIN_H
 | 
			
		||||
 | 
			
		||||
#include <storage/ipc.h>
 | 
			
		||||
 | 
			
		||||
/* -----------------
 | 
			
		||||
 *  have to use relative address as pointers in the hashtable
 | 
			
		||||
 *  because the hashtable may reallocate in difference processes
 | 
			
		||||
 *	have to use relative address as pointers in the hashtable
 | 
			
		||||
 *	because the hashtable may reallocate in difference processes
 | 
			
		||||
 * -----------------
 | 
			
		||||
 */
 | 
			
		||||
typedef int	RelativeAddr;
 | 
			
		||||
typedef int		RelativeAddr;
 | 
			
		||||
 | 
			
		||||
/* ------------------
 | 
			
		||||
 *  the relative addresses are always relative to the head of the
 | 
			
		||||
 *  hashtable, the following macro converts them to absolute address.
 | 
			
		||||
 *	the relative addresses are always relative to the head of the
 | 
			
		||||
 *	hashtable, the following macro converts them to absolute address.
 | 
			
		||||
 * ------------------
 | 
			
		||||
 */
 | 
			
		||||
#define ABSADDR(X)	((X) < 0 ? NULL: (char*)hashtable + X)
 | 
			
		||||
#define RELADDR(X)	(RelativeAddr)((char*)(X) - (char*)hashtable)
 | 
			
		||||
#define ABSADDR(X)		((X) < 0 ? NULL: (char*)hashtable + X)
 | 
			
		||||
#define RELADDR(X)		(RelativeAddr)((char*)(X) - (char*)hashtable)
 | 
			
		||||
 | 
			
		||||
typedef char    **charPP;
 | 
			
		||||
typedef int     *intP;
 | 
			
		||||
typedef char  **charPP;
 | 
			
		||||
typedef int    *intP;
 | 
			
		||||
 | 
			
		||||
/* ----------------------------------------------------------------
 | 
			
		||||
 *		hash-join hash table structures
 | 
			
		||||
 *				hash-join hash table structures
 | 
			
		||||
 * ----------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
typedef struct HashTableData {
 | 
			
		||||
    int		    nbuckets;
 | 
			
		||||
    int		    totalbuckets;
 | 
			
		||||
    int		    bucketsize;
 | 
			
		||||
    IpcMemoryId	    shmid;
 | 
			
		||||
    RelativeAddr    top;		/* char* */
 | 
			
		||||
    RelativeAddr    bottom;		/* char* */
 | 
			
		||||
    RelativeAddr    overflownext; 	/* char* */
 | 
			
		||||
    RelativeAddr    batch;		/* char* */
 | 
			
		||||
    RelativeAddr    readbuf; 		/* char* */
 | 
			
		||||
    int             nbatch;
 | 
			
		||||
    RelativeAddr    outerbatchNames; 	/* RelativeAddr* */
 | 
			
		||||
    RelativeAddr    outerbatchPos;	/* RelativeAddr* */
 | 
			
		||||
    RelativeAddr    innerbatchNames; 	/* RelativeAddr* */
 | 
			
		||||
    RelativeAddr    innerbatchPos; 	/* RelativeAddr* */
 | 
			
		||||
    RelativeAddr    innerbatchSizes; 	/* int* */
 | 
			
		||||
    int             curbatch;
 | 
			
		||||
    int		    nprocess;
 | 
			
		||||
    int		    pcount;
 | 
			
		||||
} HashTableData;		/* real hash table follows here */
 | 
			
		||||
typedef struct HashTableData
 | 
			
		||||
{
 | 
			
		||||
	int				nbuckets;
 | 
			
		||||
	int				totalbuckets;
 | 
			
		||||
	int				bucketsize;
 | 
			
		||||
	IpcMemoryId		shmid;
 | 
			
		||||
	RelativeAddr	top;		/* char* */
 | 
			
		||||
	RelativeAddr	bottom;		/* char* */
 | 
			
		||||
	RelativeAddr	overflownext;		/* char* */
 | 
			
		||||
	RelativeAddr	batch;		/* char* */
 | 
			
		||||
	RelativeAddr	readbuf;	/* char* */
 | 
			
		||||
	int				nbatch;
 | 
			
		||||
	RelativeAddr	outerbatchNames;	/* RelativeAddr* */
 | 
			
		||||
	RelativeAddr	outerbatchPos;		/* RelativeAddr* */
 | 
			
		||||
	RelativeAddr	innerbatchNames;	/* RelativeAddr* */
 | 
			
		||||
	RelativeAddr	innerbatchPos;		/* RelativeAddr* */
 | 
			
		||||
	RelativeAddr	innerbatchSizes;	/* int* */
 | 
			
		||||
	int				curbatch;
 | 
			
		||||
	int				nprocess;
 | 
			
		||||
	int				pcount;
 | 
			
		||||
}				HashTableData;	/* real hash table follows here */
 | 
			
		||||
 | 
			
		||||
typedef HashTableData	*HashJoinTable;
 | 
			
		||||
typedef HashTableData *HashJoinTable;
 | 
			
		||||
 | 
			
		||||
typedef struct OverflowTupleData {
 | 
			
		||||
    RelativeAddr tuple;		/* HeapTuple */
 | 
			
		||||
    RelativeAddr next;		/* struct OverflowTupleData * */
 | 
			
		||||
} OverflowTupleData;		/* real tuple follows here */
 | 
			
		||||
typedef struct OverflowTupleData
 | 
			
		||||
{
 | 
			
		||||
	RelativeAddr	tuple;		/* HeapTuple */
 | 
			
		||||
	RelativeAddr	next;		/* struct OverflowTupleData * */
 | 
			
		||||
}				OverflowTupleData;		/* real tuple follows here */
 | 
			
		||||
 | 
			
		||||
typedef OverflowTupleData *OverflowTuple;
 | 
			
		||||
 | 
			
		||||
typedef struct HashBucketData {
 | 
			
		||||
    RelativeAddr  top;		/* HeapTuple */
 | 
			
		||||
    RelativeAddr  bottom;	/* HeapTuple */
 | 
			
		||||
    RelativeAddr  firstotuple; 	/* OverflowTuple */
 | 
			
		||||
    RelativeAddr  lastotuple; 	/* OverflowTuple */
 | 
			
		||||
} HashBucketData;		/* real bucket follows here */
 | 
			
		||||
typedef struct HashBucketData
 | 
			
		||||
{
 | 
			
		||||
	RelativeAddr	top;		/* HeapTuple */
 | 
			
		||||
	RelativeAddr	bottom;		/* HeapTuple */
 | 
			
		||||
	RelativeAddr	firstotuple;/* OverflowTuple */
 | 
			
		||||
	RelativeAddr	lastotuple; /* OverflowTuple */
 | 
			
		||||
}				HashBucketData; /* real bucket follows here */
 | 
			
		||||
 | 
			
		||||
typedef HashBucketData	*HashBucket;
 | 
			
		||||
typedef HashBucketData *HashBucket;
 | 
			
		||||
 | 
			
		||||
#define HASH_PERMISSION         0700
 | 
			
		||||
#define HASH_PERMISSION			0700
 | 
			
		||||
 | 
			
		||||
#endif	/* HASHJOIN_H */
 | 
			
		||||
#endif							/* HASHJOIN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeAgg.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeAgg.h,v 1.1 1996/08/28 07:22:14 scrappy Exp $
 | 
			
		||||
 * $Id: nodeAgg.h,v 1.2 1997/09/07 04:57:50 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEAGG_H
 | 
			
		||||
#define	NODEAGG_H
 | 
			
		||||
#ifndef NODEAGG_H
 | 
			
		||||
#define NODEAGG_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecAgg(Agg *node);
 | 
			
		||||
extern bool ExecInitAgg(Agg *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsAgg(Agg *node);
 | 
			
		||||
extern void ExecEndAgg(Agg *node);
 | 
			
		||||
extern TupleTableSlot *ExecAgg(Agg * node);
 | 
			
		||||
extern bool		ExecInitAgg(Agg * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsAgg(Agg * node);
 | 
			
		||||
extern void		ExecEndAgg(Agg * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEAGG_H */
 | 
			
		||||
#endif							/* NODEAGG_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeAppend.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeAppend.h,v 1.2 1997/08/19 21:38:19 momjian Exp $
 | 
			
		||||
 * $Id: nodeAppend.h,v 1.3 1997/09/07 04:57:51 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEAPPEND_H
 | 
			
		||||
#define	NODEAPPEND_H
 | 
			
		||||
#ifndef NODEAPPEND_H
 | 
			
		||||
#define NODEAPPEND_H
 | 
			
		||||
 | 
			
		||||
extern bool ExecInitAppend(Append *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsAppend(Append *node);
 | 
			
		||||
extern TupleTableSlot *ExecProcAppend(Append *node);
 | 
			
		||||
extern void ExecEndAppend(Append *node);
 | 
			
		||||
extern bool		ExecInitAppend(Append * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsAppend(Append * node);
 | 
			
		||||
extern TupleTableSlot *ExecProcAppend(Append * node);
 | 
			
		||||
extern void		ExecEndAppend(Append * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEAPPEND_H */
 | 
			
		||||
#endif							/* NODEAPPEND_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeGroup.h--
 | 
			
		||||
 *    prototypes for nodeGroup.c
 | 
			
		||||
 *	  prototypes for nodeGroup.c
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeGroup.h,v 1.1 1996/08/28 07:22:17 scrappy Exp $
 | 
			
		||||
 * $Id: nodeGroup.h,v 1.2 1997/09/07 04:57:52 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEGROUP_H
 | 
			
		||||
#define	NODEGROUP_H
 | 
			
		||||
#ifndef NODEGROUP_H
 | 
			
		||||
#define NODEGROUP_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecGroup(Group *node);
 | 
			
		||||
extern bool ExecInitGroup(Group *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsGroup(Group *node);
 | 
			
		||||
extern void ExecEndGroup(Group *node);
 | 
			
		||||
extern TupleTableSlot *ExecGroup(Group * node);
 | 
			
		||||
extern bool		ExecInitGroup(Group * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsGroup(Group * node);
 | 
			
		||||
extern void		ExecEndGroup(Group * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEGROUP_H */
 | 
			
		||||
#endif							/* NODEGROUP_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,31 +1,34 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeHash.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeHash.h,v 1.2 1997/08/19 21:38:20 momjian Exp $
 | 
			
		||||
 * $Id: nodeHash.h,v 1.3 1997/09/07 04:57:52 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEHASH_H
 | 
			
		||||
#define	NODEHASH_H
 | 
			
		||||
#ifndef NODEHASH_H
 | 
			
		||||
#define NODEHASH_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecHash(Hash *node);
 | 
			
		||||
extern bool ExecInitHash(Hash *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsHash(Hash *node);
 | 
			
		||||
extern void ExecEndHash(Hash *node);
 | 
			
		||||
extern HashJoinTable ExecHashTableCreate(Hash *node);
 | 
			
		||||
extern void ExecHashTableInsert(HashJoinTable hashtable, ExprContext *econtext,
 | 
			
		||||
				Var *hashkey, File *batches);
 | 
			
		||||
extern void ExecHashTableDestroy(HashJoinTable hashtable);
 | 
			
		||||
extern int ExecHashGetBucket(HashJoinTable hashtable, ExprContext *econtext,
 | 
			
		||||
			     Var *hashkey);
 | 
			
		||||
extern HeapTuple ExecScanHashBucket(HashJoinState *hjstate, HashBucket bucket,
 | 
			
		||||
				    HeapTuple curtuple, List *hjclauses,
 | 
			
		||||
				    ExprContext *econtext);
 | 
			
		||||
extern void ExecHashTableReset(HashJoinTable hashtable, int ntuples);
 | 
			
		||||
extern TupleTableSlot *ExecHash(Hash * node);
 | 
			
		||||
extern bool		ExecInitHash(Hash * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsHash(Hash * node);
 | 
			
		||||
extern void		ExecEndHash(Hash * node);
 | 
			
		||||
extern HashJoinTable ExecHashTableCreate(Hash * node);
 | 
			
		||||
extern void
 | 
			
		||||
ExecHashTableInsert(HashJoinTable hashtable, ExprContext * econtext,
 | 
			
		||||
					Var * hashkey, File * batches);
 | 
			
		||||
extern void		ExecHashTableDestroy(HashJoinTable hashtable);
 | 
			
		||||
extern int
 | 
			
		||||
ExecHashGetBucket(HashJoinTable hashtable, ExprContext * econtext,
 | 
			
		||||
				  Var * hashkey);
 | 
			
		||||
extern HeapTuple
 | 
			
		||||
ExecScanHashBucket(HashJoinState * hjstate, HashBucket bucket,
 | 
			
		||||
				   HeapTuple curtuple, List * hjclauses,
 | 
			
		||||
				   ExprContext * econtext);
 | 
			
		||||
extern void		ExecHashTableReset(HashJoinTable hashtable, int ntuples);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEHASH_H */
 | 
			
		||||
#endif							/* NODEHASH_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,28 +1,29 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeHashjoin.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeHashjoin.h,v 1.2 1997/08/19 21:38:22 momjian Exp $
 | 
			
		||||
 * $Id: nodeHashjoin.h,v 1.3 1997/09/07 04:57:53 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEHASHJOIN_H
 | 
			
		||||
#define	NODEHASHJOIN_H
 | 
			
		||||
#ifndef NODEHASHJOIN_H
 | 
			
		||||
#define NODEHASHJOIN_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecHashJoin(HashJoin *node);
 | 
			
		||||
extern TupleTableSlot *ExecHashJoin(HashJoin * node);
 | 
			
		||||
 | 
			
		||||
extern bool ExecInitHashJoin(HashJoin *node, EState *estate, Plan *parent);
 | 
			
		||||
extern bool		ExecInitHashJoin(HashJoin * node, EState * estate, Plan * parent);
 | 
			
		||||
 | 
			
		||||
extern int ExecCountSlotsHashJoin(HashJoin *node);
 | 
			
		||||
extern int		ExecCountSlotsHashJoin(HashJoin * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecEndHashJoin(HashJoin *node);
 | 
			
		||||
extern void		ExecEndHashJoin(HashJoin * node);
 | 
			
		||||
 | 
			
		||||
extern char *ExecHashJoinSaveTuple(HeapTuple heapTuple, char *buffer,
 | 
			
		||||
				   File file, char *position);
 | 
			
		||||
extern char    *
 | 
			
		||||
ExecHashJoinSaveTuple(HeapTuple heapTuple, char *buffer,
 | 
			
		||||
					  File file, char *position);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEHASHJOIN_H */
 | 
			
		||||
#endif							/* NODEHASHJOIN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,33 +1,34 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeIndexscan.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeIndexscan.h,v 1.2 1996/10/23 07:41:34 scrappy Exp $
 | 
			
		||||
 * $Id: nodeIndexscan.h,v 1.3 1997/09/07 04:57:54 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEINDEXSCAN_H
 | 
			
		||||
#define	NODEINDEXSCAN_H
 | 
			
		||||
#ifndef NODEINDEXSCAN_H
 | 
			
		||||
#define NODEINDEXSCAN_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecIndexScan(IndexScan *node);
 | 
			
		||||
extern TupleTableSlot *ExecIndexScan(IndexScan * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan *parent);
 | 
			
		||||
extern void		ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent);
 | 
			
		||||
 | 
			
		||||
extern void ExecEndIndexScan(IndexScan *node);
 | 
			
		||||
extern void		ExecEndIndexScan(IndexScan * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecIndexMarkPos(IndexScan *node);
 | 
			
		||||
extern void		ExecIndexMarkPos(IndexScan * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecIndexRestrPos(IndexScan *node);
 | 
			
		||||
extern void		ExecIndexRestrPos(IndexScan * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecUpdateIndexScanKeys(IndexScan *node, ExprContext *econtext);
 | 
			
		||||
extern void		ExecUpdateIndexScanKeys(IndexScan * node, ExprContext * econtext);
 | 
			
		||||
 | 
			
		||||
extern bool ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent);
 | 
			
		||||
extern bool		ExecInitIndexScan(IndexScan * node, EState * estate, Plan * parent);
 | 
			
		||||
 | 
			
		||||
extern int ExecCountSlotsIndexScan(IndexScan *node);
 | 
			
		||||
extern int		ExecCountSlotsIndexScan(IndexScan * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecIndexReScan(IndexScan *node, ExprContext *exprCtxt, Plan* parent);
 | 
			
		||||
#endif	/* NODEINDEXSCAN_H */
 | 
			
		||||
extern void		ExecIndexReScan(IndexScan * node, ExprContext * exprCtxt, Plan * parent);
 | 
			
		||||
 | 
			
		||||
#endif							/* NODEINDEXSCAN_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,23 +1,23 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeMaterial.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeMaterial.h,v 1.1 1996/08/28 07:22:21 scrappy Exp $
 | 
			
		||||
 * $Id: nodeMaterial.h,v 1.2 1997/09/07 04:57:55 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEMATERIAL_H
 | 
			
		||||
#define	NODEMATERIAL_H
 | 
			
		||||
#ifndef NODEMATERIAL_H
 | 
			
		||||
#define NODEMATERIAL_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecMaterial(Material *node);
 | 
			
		||||
extern bool ExecInitMaterial(Material *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsMaterial(Material *node);
 | 
			
		||||
extern void ExecEndMaterial(Material *node);
 | 
			
		||||
extern List ExecMaterialMarkPos(Material *node);
 | 
			
		||||
extern void ExecMaterialRestrPos(Material *node);
 | 
			
		||||
extern TupleTableSlot *ExecMaterial(Material * node);
 | 
			
		||||
extern bool		ExecInitMaterial(Material * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsMaterial(Material * node);
 | 
			
		||||
extern void		ExecEndMaterial(Material * node);
 | 
			
		||||
extern List		ExecMaterialMarkPos(Material * node);
 | 
			
		||||
extern void		ExecMaterialRestrPos(Material * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEMATERIAL_H */
 | 
			
		||||
#endif							/* NODEMATERIAL_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,24 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeMergejoin.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeMergejoin.h,v 1.3 1997/08/19 21:38:22 momjian Exp $
 | 
			
		||||
 * $Id: nodeMergejoin.h,v 1.4 1997/09/07 04:57:56 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODEMERGEJOIN_H
 | 
			
		||||
#define	NODEMERGEJOIN_H
 | 
			
		||||
#ifndef NODEMERGEJOIN_H
 | 
			
		||||
#define NODEMERGEJOIN_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecMergeJoin(MergeJoin *node);
 | 
			
		||||
extern TupleTableSlot *ExecMergeJoin(MergeJoin * node);
 | 
			
		||||
 | 
			
		||||
extern bool ExecInitMergeJoin(MergeJoin *node, EState *estate, Plan *parent);
 | 
			
		||||
extern bool		ExecInitMergeJoin(MergeJoin * node, EState * estate, Plan * parent);
 | 
			
		||||
 | 
			
		||||
extern int ExecCountSlotsMergeJoin(MergeJoin *node);
 | 
			
		||||
extern int		ExecCountSlotsMergeJoin(MergeJoin * node);
 | 
			
		||||
 | 
			
		||||
extern void ExecEndMergeJoin(MergeJoin *node);
 | 
			
		||||
extern void		ExecEndMergeJoin(MergeJoin * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODEMERGEJOIN_H; */
 | 
			
		||||
#endif							/* NODEMERGEJOIN_H; */
 | 
			
		||||
 
 | 
			
		||||
@@ -1,21 +1,21 @@
 | 
			
		||||
/*-------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * nodeNestloop.h--
 | 
			
		||||
 *    
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) 1994, Regents of the University of California
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: nodeNestloop.h,v 1.1 1996/08/28 07:22:23 scrappy Exp $
 | 
			
		||||
 * $Id: nodeNestloop.h,v 1.2 1997/09/07 04:57:57 momjian Exp $
 | 
			
		||||
 *
 | 
			
		||||
 *-------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
#ifndef	NODENESTLOOP_H
 | 
			
		||||
#define	NODENESTLOOP_H
 | 
			
		||||
#ifndef NODENESTLOOP_H
 | 
			
		||||
#define NODENESTLOOP_H
 | 
			
		||||
 | 
			
		||||
extern TupleTableSlot *ExecNestLoop(NestLoop *node, Plan *parent);
 | 
			
		||||
extern bool ExecInitNestLoop(NestLoop *node, EState *estate, Plan *parent);
 | 
			
		||||
extern int ExecCountSlotsNestLoop(NestLoop *node);
 | 
			
		||||
extern void ExecEndNestLoop(NestLoop *node);
 | 
			
		||||
extern TupleTableSlot *ExecNestLoop(NestLoop * node, Plan * parent);
 | 
			
		||||
extern bool		ExecInitNestLoop(NestLoop * node, EState * estate, Plan * parent);
 | 
			
		||||
extern int		ExecCountSlotsNestLoop(NestLoop * node);
 | 
			
		||||
extern void		ExecEndNestLoop(NestLoop * node);
 | 
			
		||||
 | 
			
		||||
#endif	/* NODENESTLOOP_H */
 | 
			
		||||
#endif							/* NODENESTLOOP_H */
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user