OSDN Git Service

Fix typo in sslmode documentation
[pg-rex/syncrep.git] / src / include / catalog / index.h
1 /*-------------------------------------------------------------------------
2  *
3  * index.h
4  *        prototypes for catalog/index.c.
5  *
6  *
7  * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/index.h
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 void index_check_primary_key(Relation heapRel,
32                                                 IndexInfo *indexInfo,
33                                                 bool is_alter_table);
34
35 extern Oid index_create(Relation heapRelation,
36                          const char *indexRelationName,
37                          Oid indexRelationId,
38                          IndexInfo *indexInfo,
39                          List *indexColNames,
40                          Oid accessMethodObjectId,
41                          Oid tableSpaceId,
42                          Oid *collationObjectId,
43                          Oid *classObjectId,
44                          int16 *coloptions,
45                          Datum reloptions,
46                          bool isprimary,
47                          bool isconstraint,
48                          bool deferrable,
49                          bool initdeferred,
50                          bool allow_system_table_mods,
51                          bool skip_build,
52                          bool concurrent);
53
54 extern void index_constraint_create(Relation heapRelation,
55                                                 Oid indexRelationId,
56                                                 IndexInfo *indexInfo,
57                                                 const char *constraintName,
58                                                 char constraintType,
59                                                 bool deferrable,
60                                                 bool initdeferred,
61                                                 bool mark_as_primary,
62                                                 bool update_pgindex,
63                                                 bool allow_system_table_mods);
64
65 extern void index_drop(Oid indexId);
66
67 extern IndexInfo *BuildIndexInfo(Relation index);
68
69 extern void FormIndexDatum(IndexInfo *indexInfo,
70                            TupleTableSlot *slot,
71                            EState *estate,
72                            Datum *values,
73                            bool *isnull);
74
75 extern void index_build(Relation heapRelation,
76                         Relation indexRelation,
77                         IndexInfo *indexInfo,
78                         bool isprimary,
79                         bool isreindex);
80
81 extern double IndexBuildHeapScan(Relation heapRelation,
82                                    Relation indexRelation,
83                                    IndexInfo *indexInfo,
84                                    bool allow_sync,
85                                    IndexBuildCallback callback,
86                                    void *callback_state);
87
88 extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot);
89
90 extern void reindex_index(Oid indexId, bool skip_constraint_checks);
91
92 /* Flag bits for reindex_relation(): */
93 #define REINDEX_REL_PROCESS_TOAST               0x01
94 #define REINDEX_REL_SUPPRESS_INDEX_USE  0x02
95 #define REINDEX_REL_CHECK_CONSTRAINTS   0x04
96
97 extern bool reindex_relation(Oid relid, int flags);
98
99 extern bool ReindexIsProcessingHeap(Oid heapOid);
100 extern bool ReindexIsProcessingIndex(Oid indexOid);
101
102 #endif   /* INDEX_H */