OSDN Git Service

Update copyrights to 2003.
[pg-rex/syncrep.git] / src / include / catalog / index.h
1 /*-------------------------------------------------------------------------
2  *
3  * index.h
4  *        prototypes for index.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: index.h,v 1.52 2003/08/04 02:40:10 momjian 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 *attdata,
28                                                                                                 char *nulls,
29                                                                                                 bool tupleIsAlive,
30                                                                                                 void *state);
31
32
33 extern Oid index_create(Oid heapRelationId,
34                          const char *indexRelationName,
35                          IndexInfo *indexInfo,
36                          Oid accessMethodObjectId,
37                          Oid *classObjectId,
38                          bool primary,
39                          bool isconstraint,
40                          bool allow_system_table_mods);
41
42 extern void index_drop(Oid indexId);
43
44 extern IndexInfo *BuildIndexInfo(Relation index);
45
46 extern void FormIndexDatum(IndexInfo *indexInfo,
47                            HeapTuple heapTuple,
48                            TupleDesc heapDescriptor,
49                            EState *estate,
50                            Datum *datum,
51                            char *nullv);
52
53 extern void UpdateStats(Oid relid, double reltuples);
54 extern bool IndexesAreActive(Relation heaprel);
55 extern void setRelhasindex(Oid relid, bool hasindex,
56                            bool isprimary, Oid reltoastidxid);
57
58 extern void setNewRelfilenode(Relation relation);
59
60 extern bool SetReindexProcessing(bool processing);
61 extern bool IsReindexProcessing(void);
62
63 extern void index_build(Relation heapRelation, Relation indexRelation,
64                         IndexInfo *indexInfo);
65
66 extern double IndexBuildHeapScan(Relation heapRelation,
67                                    Relation indexRelation,
68                                    IndexInfo *indexInfo,
69                                    IndexBuildCallback callback,
70                                    void *callback_state);
71
72 extern bool activate_indexes_of_a_table(Relation heaprel, bool activate);
73
74 extern bool reindex_index(Oid indexId, bool force, bool inplace);
75 extern bool reindex_relation(Oid relid, bool force);
76
77 #endif   /* INDEX_H */