]> granicus.if.org Git - postgresql/blob - src/include/catalog/index.h
6819426d49eff200e7e38f164a1c7e07b2b0f3d3
[postgresql] / src / include / catalog / index.h
1 /*-------------------------------------------------------------------------
2  *
3  * index.h
4  *        prototypes for catalog/index.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $PostgreSQL: pgsql/src/include/catalog/index.h,v 1.66 2006/05/10 23:18:39 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef INDEX_H
15 #define INDEX_H
16
17 #include "access/itup.h"
18 #include "catalog/pg_index.h"
19 #include "nodes/execnodes.h"
20
21
22 #define DEFAULT_INDEX_TYPE      "btree"
23
24 /* Typedef for callback function for IndexBuildHeapScan */
25 typedef void (*IndexBuildCallback) (Relation index,
26                                                                                                 HeapTuple htup,
27                                                                                                 Datum *values,
28                                                                                                 bool *isnull,
29                                                                                                 bool tupleIsAlive,
30                                                                                                 void *state);
31
32
33 extern Oid index_create(Oid heapRelationId,
34                          const char *indexRelationName,
35                          Oid indexRelationId,
36                          IndexInfo *indexInfo,
37                          Oid accessMethodObjectId,
38                          Oid tableSpaceId,
39                          Oid *classObjectId,
40                          bool isprimary,
41                          bool istoast,
42                          bool isconstraint,
43                          bool allow_system_table_mods,
44                          bool skip_build);
45
46 extern void index_drop(Oid indexId);
47
48 extern IndexInfo *BuildIndexInfo(Relation index);
49
50 extern void FormIndexDatum(IndexInfo *indexInfo,
51                            TupleTableSlot *slot,
52                            EState *estate,
53                            Datum *values,
54                            bool *isnull);
55
56 extern void setNewRelfilenode(Relation relation);
57
58 extern void index_build(Relation heapRelation,
59                         Relation indexRelation,
60                         IndexInfo *indexInfo,
61                         bool isprimary,
62                         bool istoast);
63
64 extern double IndexBuildHeapScan(Relation heapRelation,
65                                    Relation indexRelation,
66                                    IndexInfo *indexInfo,
67                                    IndexBuildCallback callback,
68                                    void *callback_state);
69
70 extern void reindex_index(Oid indexId);
71 extern bool reindex_relation(Oid relid, bool toast_too);
72
73 #endif   /* INDEX_H */