~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-updates

« back to all changes in this revision

Viewing changes to src/include/catalog/pg_index.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2009, PostgreSQL Global Development Group
 
9
 * Portions Copyright (c) 1994, Regents of the University of California
 
10
 *
 
11
 * $PostgreSQL$
 
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
#include "catalog/genbki.h"
 
23
 
 
24
/* ----------------
 
25
 *              pg_index definition.  cpp turns this into
 
26
 *              typedef struct FormData_pg_index.
 
27
 * ----------------
 
28
 */
 
29
#define IndexRelationId  2610
 
30
 
 
31
CATALOG(pg_index,2610) BKI_WITHOUT_OIDS
 
32
{
 
33
        Oid                     indexrelid;             /* OID of the index */
 
34
        Oid                     indrelid;               /* OID of the relation it indexes */
 
35
        int2            indnatts;               /* number of columns in index */
 
36
        bool            indisunique;    /* is this a unique index? */
 
37
        bool            indisprimary;   /* is this index for primary key? */
 
38
        bool            indisclustered; /* is this the index last clustered by? */
 
39
        bool            indisvalid;             /* is this index valid for use by queries? */
 
40
        bool            indcheckxmin;   /* must we wait for xmin to be old? */
 
41
        bool            indisready;             /* is this index ready for inserts? */
 
42
 
 
43
        /* VARIABLE LENGTH FIELDS: */
 
44
        int2vector      indkey;                 /* column numbers of indexed cols, or 0 */
 
45
        oidvector       indclass;               /* opclass identifiers */
 
46
        int2vector      indoption;              /* per-column flags (AM-specific meanings) */
 
47
        text            indexprs;               /* expression trees for index attributes that
 
48
                                                                 * are not simple column references; one for
 
49
                                                                 * each zero entry in indkey[] */
 
50
        text            indpred;                /* expression tree for predicate, if a partial
 
51
                                                                 * index; else NULL */
 
52
} FormData_pg_index;
 
53
 
 
54
/* ----------------
 
55
 *              Form_pg_index corresponds to a pointer to a tuple with
 
56
 *              the format of pg_index relation.
 
57
 * ----------------
 
58
 */
 
59
typedef FormData_pg_index *Form_pg_index;
 
60
 
 
61
/* ----------------
 
62
 *              compiler constants for pg_index
 
63
 * ----------------
 
64
 */
 
65
#define Natts_pg_index                                  14
 
66
#define Anum_pg_index_indexrelid                1
 
67
#define Anum_pg_index_indrelid                  2
 
68
#define Anum_pg_index_indnatts                  3
 
69
#define Anum_pg_index_indisunique               4
 
70
#define Anum_pg_index_indisprimary              5
 
71
#define Anum_pg_index_indisclustered    6
 
72
#define Anum_pg_index_indisvalid                7
 
73
#define Anum_pg_index_indcheckxmin              8
 
74
#define Anum_pg_index_indisready                9
 
75
#define Anum_pg_index_indkey                    10
 
76
#define Anum_pg_index_indclass                  11
 
77
#define Anum_pg_index_indoption                 12
 
78
#define Anum_pg_index_indexprs                  13
 
79
#define Anum_pg_index_indpred                   14
 
80
 
 
81
/*
 
82
 * Index AMs that support ordered scans must support these two indoption
 
83
 * bits.  Otherwise, the content of the per-column indoption fields is
 
84
 * open for future definition.
 
85
 */
 
86
#define INDOPTION_DESC                  0x0001  /* values are in reverse order */
 
87
#define INDOPTION_NULLS_FIRST   0x0002  /* NULLs are first instead of last */
 
88
 
 
89
#endif   /* PG_INDEX_H */