1 /*-------------------------------------------------------------------------
4 * prototypes for catalog/index.c.
7 * Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/catalog/index.h
12 *-------------------------------------------------------------------------
17 #include "nodes/execnodes.h"
20 #define DEFAULT_INDEX_TYPE "btree"
22 /* Typedef for callback function for IndexBuildHeapScan */
23 typedef void (*IndexBuildCallback) (Relation index,
31 extern void index_check_primary_key(Relation heapRel,
35 extern Oid index_create(Relation heapRelation,
36 const char *indexRelationName,
41 Oid accessMethodObjectId,
43 Oid *collationObjectId,
51 bool allow_system_table_mods,
55 extern void index_constraint_create(Relation heapRelation,
58 const char *constraintName,
64 bool allow_system_table_mods);
66 extern void index_drop(Oid indexId);
68 extern IndexInfo *BuildIndexInfo(Relation index);
70 extern void FormIndexDatum(IndexInfo *indexInfo,
76 extern void index_build(Relation heapRelation,
77 Relation indexRelation,
82 extern double IndexBuildHeapScan(Relation heapRelation,
83 Relation indexRelation,
86 IndexBuildCallback callback,
87 void *callback_state);
89 extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot);
91 extern void reindex_index(Oid indexId, bool skip_constraint_checks);
93 /* Flag bits for reindex_relation(): */
94 #define REINDEX_REL_PROCESS_TOAST 0x01
95 #define REINDEX_REL_SUPPRESS_INDEX_USE 0x02
96 #define REINDEX_REL_CHECK_CONSTRAINTS 0x04
98 extern bool reindex_relation(Oid relid, int flags);
100 extern bool ReindexIsProcessingHeap(Oid heapOid);
101 extern bool ReindexIsProcessingIndex(Oid indexOid);