]> granicus.if.org Git - postgresql/blob - src/include/catalog/index.h
Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in
[postgresql] / src / include / catalog / index.h
1 /*-------------------------------------------------------------------------
2  *
3  * index.h
4  *        prototypes for index.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: index.h,v 1.39 2001/08/21 16:36:05 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef INDEX_H
15 #define INDEX_H
16
17 #include "access/itup.h"
18 #include "nodes/execnodes.h"
19
20
21 /* Typedef for callback function for IndexBuildHeapScan */
22 typedef void (*IndexBuildCallback) (Relation index,
23                                                                         HeapTuple htup,
24                                                                         Datum *attdata,
25                                                                         char *nulls,
26                                                                         bool tupleIsAlive,
27                                                                         void *state);
28
29
30 extern Form_pg_am AccessMethodObjectIdGetForm(Oid accessMethodObjectId,
31                                                         MemoryContext resultCxt);
32
33 extern void InitIndexStrategy(int numatts,
34                                   Relation indexRelation,
35                                   Oid accessMethodObjectId);
36
37 extern Oid index_create(char *heapRelationName,
38                          char *indexRelationName,
39                          IndexInfo *indexInfo,
40                          Oid accessMethodObjectId,
41                          Oid *classObjectId,
42                          bool primary,
43                          bool allow_system_table_mods);
44
45 extern void index_drop(Oid indexId);
46
47 extern IndexInfo *BuildIndexInfo(HeapTuple indexTuple);
48
49 extern void FormIndexDatum(IndexInfo *indexInfo,
50                            HeapTuple heapTuple,
51                            TupleDesc heapDescriptor,
52                            MemoryContext resultCxt,
53                            Datum *datum,
54                            char *nullv);
55
56 extern void UpdateStats(Oid relid, double reltuples);
57 extern bool IndexesAreActive(Oid relid, bool comfirmCommitted);
58 extern void setRelhasindex(Oid relid, bool hasindex,
59                                                    bool isprimary, Oid reltoastidxid);
60
61 extern void setNewRelfilenode(Relation relation);
62
63 extern bool SetReindexProcessing(bool processing);
64 extern bool IsReindexProcessing(void);
65
66 extern void index_build(Relation heapRelation, Relation indexRelation,
67                                                 IndexInfo *indexInfo);
68
69 extern double IndexBuildHeapScan(Relation heapRelation,
70                                                                  Relation indexRelation,
71                                                                  IndexInfo *indexInfo,
72                                                                  IndexBuildCallback callback,
73                                                                  void *callback_state);
74
75 extern bool reindex_index(Oid indexId, bool force, bool inplace);
76 extern bool activate_indexes_of_a_table(Oid relid, bool activate);
77 extern bool reindex_relation(Oid relid, bool force);
78
79 #endif   /* INDEX_H */