OSDN Git Service

3a0a60ffd6d54511fdbab5843c8a7e8929bbd2e4
[pg-rex/syncrep.git] / src / include / catalog / pg_index.h
1 /*-------------------------------------------------------------------------
2  *
3  * pg_index.h
4  *        definition of the system "index" relation (pg_index)
5  *        along with the relation's initial contents.
6  *
7  *
8  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $Id: pg_index.h,v 1.25 2001/10/25 05:49:57 momjian Exp $
12  *
13  * NOTES
14  *        the genbki.sh script reads this file and generates .bki
15  *        information from the DATA() statements.
16  *
17  *-------------------------------------------------------------------------
18  */
19 #ifndef PG_INDEX_H
20 #define PG_INDEX_H
21
22 /* ----------------
23  *              postgres.h contains the system type definintions and the
24  *              CATALOG(), BOOTSTRAP and DATA() sugar words so this file
25  *              can be read by both genbki.sh and the C compiler.
26  * ----------------
27  */
28
29 /* ----------------
30  *              pg_index definition.  cpp turns this into
31  *              typedef struct FormData_pg_index.
32  * ----------------
33  */
34 CATALOG(pg_index) BKI_WITHOUT_OIDS
35 {
36         Oid                     indexrelid;             /* OID of the index */
37         Oid                     indrelid;               /* OID of the relation it indexes */
38         regproc         indproc;                /* OID of function for functional index */
39         int2vector      indkey;                 /* column numbers of indexed attributes */
40         oidvector       indclass;               /* opclass identifiers */
41         bool            indisclustered; /* presently unused */
42         bool            indisunique;    /* is this a unique index? */
43         bool            indisprimary;   /* is this index for primary key? */
44         Oid                     indreference;   /* oid of index of referenced relation (ie
45                                                                  * - this index for foreign key) */
46
47         /* VARIABLE LENGTH FIELD: */
48         text            indpred;                /* expression tree for predicate, if a
49                                                                  * partial index */
50 } FormData_pg_index;
51
52 /* ----------------
53  *              Form_pg_index corresponds to a pointer to a tuple with
54  *              the format of pg_index relation.
55  * ----------------
56  */
57 typedef FormData_pg_index *Form_pg_index;
58
59 /* ----------------
60  *              compiler constants for pg_index
61  * ----------------
62  */
63 #define Natts_pg_index                                  10
64 #define Anum_pg_index_indexrelid                1
65 #define Anum_pg_index_indrelid                  2
66 #define Anum_pg_index_indproc                   3
67 #define Anum_pg_index_indkey                    4
68 #define Anum_pg_index_indclass                  5
69 #define Anum_pg_index_indisclustered    6
70 #define Anum_pg_index_indisunique               7
71 #define Anum_pg_index_indisprimary              8
72 #define Anum_pg_index_indreference              9
73 #define Anum_pg_index_indpred                   10
74 #endif   /* PG_INDEX_H */