]> granicus.if.org Git - postgresql/blob - src/include/catalog/index.h
881ef9027994445ea66b57e7aee78c092c33228a
[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.71 2006/08/25 04:06:55 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef INDEX_H
15 #define INDEX_H
16
17 #include "nodes/execnodes.h"
18
19
20 #define DEFAULT_INDEX_TYPE      "btree"
21
22 /* Typedef for callback function for IndexBuildHeapScan */
23 typedef void (*IndexBuildCallback) (Relation index,
24                                                                                                 HeapTuple htup,
25                                                                                                 Datum *values,
26                                                                                                 bool *isnull,
27                                                                                                 bool tupleIsAlive,
28                                                                                                 void *state);
29
30
31 extern Oid index_create(Oid heapRelationId,
32                          const char *indexRelationName,
33                          Oid indexRelationId,
34                          IndexInfo *indexInfo,
35                          Oid accessMethodObjectId,
36                          Oid tableSpaceId,
37                          Oid *classObjectId,
38                          Datum reloptions,
39                          bool isprimary,
40                          bool isconstraint,
41                          bool allow_system_table_mods,
42                          bool skip_build,
43                          bool concurrent);
44
45 extern void index_drop(Oid indexId);
46
47 extern IndexInfo *BuildIndexInfo(Relation index);
48
49 extern void FormIndexDatum(IndexInfo *indexInfo,
50                            TupleTableSlot *slot,
51                            EState *estate,
52                            Datum *values,
53                            bool *isnull);
54
55 extern void setNewRelfilenode(Relation relation);
56
57 extern void index_build(Relation heapRelation,
58                         Relation indexRelation,
59                         IndexInfo *indexInfo,
60                         bool isprimary);
61
62 extern double IndexBuildHeapScan(Relation heapRelation,
63                                    Relation indexRelation,
64                                    IndexInfo *indexInfo,
65                                    IndexBuildCallback callback,
66                                    void *callback_state);
67
68 extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot);
69
70 extern void reindex_index(Oid indexId);
71 extern bool reindex_relation(Oid relid, bool toast_too);
72
73 #endif   /* INDEX_H */