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,
40 Oid accessMethodObjectId,
42 Oid *collationObjectId,
50 bool allow_system_table_mods,
54 extern void index_constraint_create(Relation heapRelation,
57 const char *constraintName,
63 bool allow_system_table_mods);
65 extern void index_drop(Oid indexId);
67 extern IndexInfo *BuildIndexInfo(Relation index);
69 extern void FormIndexDatum(IndexInfo *indexInfo,
75 extern void index_build(Relation heapRelation,
76 Relation indexRelation,
81 extern double IndexBuildHeapScan(Relation heapRelation,
82 Relation indexRelation,
85 IndexBuildCallback callback,
86 void *callback_state);
88 extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot);
90 extern void reindex_index(Oid indexId, bool skip_constraint_checks);
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
97 extern bool reindex_relation(Oid relid, int flags);
99 extern bool ReindexIsProcessingHeap(Oid heapOid);
100 extern bool ReindexIsProcessingIndex(Oid indexOid);