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


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

1.5
date	91.09.18.23.36.52;	author kemnitz;	state Exp;
branches;
next	1.4;

1.4
date	91.05.04.19.58.07;	author mao;	state Exp;
branches;
next	1.3;

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

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

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


desc
@@


1.6
log
@define a constant for the maximum number of index keys
@
text
@/* ----------------------------------------------------------------
 *   FILE
 *	pg_index.h
 *
 *   DESCRIPTION
 *	definition of the system "index" relation (pg_index)
 *	along with the relation's initial contents.
 *
 *   NOTES
 *	the genbki.sh script reads this file and generates .bki
 *	information from the DATA() statements.
 *
 *   IDENTIFICATION
 *	$Header: /users/mer/postgres/src/lib/H/catalog/RCS/pg_index.h,v 1.5 1991/09/18 23:36:52 kemnitz Exp mer $
 * ----------------------------------------------------------------
 */
#ifndef PgIndexIncluded
#define PgIndexIncluded 1	/* include this only once */

/* ----------------
 *	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.
 * ----------------
 */
#include "tmp/postgres.h"

/* ----------------
 *	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.
 * ----------------
 */ 
CATALOG(pg_index) {
    oid 	indexrelid;
    oid 	indrelid;
	oid		indproc; /* registered procedure for functional index */
    int28 	indkey;
    oid8 	indclass;
    bool 	indisclustered;
    bool 	indisarchived;
} FormData_pg_index;

#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.
 * ----------------
 */
typedef FormData_pg_index	*Form_pg_index;

/* ----------------
 *	compiler constants for pg_index
 * ----------------
 */
#define Name_pg_index			"pg_index"
#define Natts_pg_index			6
#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

/* ----------------
 *	old definition of IndexTupleForm
 * ----------------
 */
#ifndef IndexTupleForm_Defined
#define IndexTupleForm_Defined 1

typedef struct IndexTupleFormD {
	ObjectId	indexrelid;
	ObjectId	indrelid;
	ObjectId	indproc;
	AttributeNumber	indkey[8];
	ObjectId	indclass[8];
	Boolean		indisclustered;
	Boolean		indisarchived;
/*	SPQUEL	inddesc; */
} IndexTupleFormD;

typedef IndexTupleFormD		*IndexTupleForm;
#define IndexTupleFormData	IndexTupleFormD

#endif IndexTupleForm_Defined

/* ----------------
 *	old definition of struct index
 * ----------------
 */
#ifndef struct_index_Defined
#define struct_index_Defined 1

struct	index {
	OID	indexrelid;
	OID	indrelid;
	int16	indkey[8];
	OID	indclass[8];
	Boolean	indisclustered;
	Boolean	indisarchived;
/*	SPQUEL	inddesc; */
};
#endif struct_index_Defined


/* ----------------
 *	old style compiler constants.  these are obsolete and
 *	should not be used -cim 6/17/90
 * ----------------
 */
#define IndexRelationIdAttributeNumber \
    Anum_pg_index_indexrelid
#define IndexHeapRelationIdAttributeNumber \
    Anum_pg_index_indrelid
#define IndexKeyAttributeNumber \
    Anum_pg_index_indkey
#define IndexIsArchivedAttributeNumber \
    Anum_pg_index_indisarchived

#define IndexRelationNumberOfAttributes	\
    Natts_pg_index
    
#endif PgIndexIncluded
@


1.5
log
@catalog support for functional indices.
@
text
@d14 1
a14 1
 *	$Header: RCS/pg_index.h,v 1.4 91/05/04 19:58:07 mao Exp Locker: kemnitz $
d44 2
@


1.4
log
@document what indexrelid and indrelid correspond to (this has been driving
me nuts for about a year).
@
text
@d14 1
a14 1
 *	$Header: RCS/pg_index.h,v 1.3 90/08/17 08:51:54 cimarron Exp Locker: mao $
d38 1
d60 5
a64 4
#define Anum_pg_index_indkey		3
#define Anum_pg_index_indclass		4
#define Anum_pg_index_indisclustered	5
#define Anum_pg_index_indisarchived	6
d76 1
@


1.3
log
@added pathnames to #include statements
@
text
@d14 1
a14 1
 *	$Header: RCS/pg_index.h,v 1.2 90/08/08 08:20:08 cimarron Exp Locker: cimarron $
d30 3
a32 1
 *	typedef struct FormData_pg_index
@


1.2
log
@reorganized some header files
@
text
@d14 1
a14 1
 *	$Header: RCS/pg_index.h,v 1.1 90/06/18 16:16:17 cimarron Version_2 Locker: cimarron $
d26 1
a26 1
#include "postgres.h"
@


1.1
log
@Initial version.  The new setup is for lib/H/catalog to contain
a pg_xxx.h file for each pg_xxx database in the system catalogs.
This .h file contains CATALOG() and DATA() statements used to
generate typedefs for the catalog tuple structures as well as
initialization scripts for createdb.
@
text
@d14 1
a14 1
 *	$Header$
d21 3
a23 3
 *	catmacros.h defines the CATALOG(), BOOTSTRAP and
 *	DATA() sugar words so this file can be read by both
 *	genbki.sh and the C compiler.
d26 1
a26 1
#include "catalog/catmacros.h"
@
