21 #define DEFAULT_INDEX_TYPE "btree"
41 #define REINDEXOPT_VERBOSE 0x01
42 #define REINDEXOPT_REPORT_PROGRESS 0x02
43 #define REINDEXOPT_MISSING_OK 0x04
44 #define REINDEXOPT_CONCURRENTLY 0x08
61 #define INDEX_CREATE_IS_PRIMARY (1 << 0)
62 #define INDEX_CREATE_ADD_CONSTRAINT (1 << 1)
63 #define INDEX_CREATE_SKIP_BUILD (1 << 2)
64 #define INDEX_CREATE_CONCURRENT (1 << 3)
65 #define INDEX_CREATE_IF_NOT_EXISTS (1 << 4)
66 #define INDEX_CREATE_PARTITIONED (1 << 5)
67 #define INDEX_CREATE_INVALID (1 << 6)
70 const char *indexRelationName,
73 Oid parentConstraintId,
76 const List *indexColNames,
79 const Oid *collationIds,
80 const Oid *opclassIds,
81 const Datum *opclassOptions,
82 const int16 *coloptions,
87 bool allow_system_table_mods,
91 #define INDEX_CONSTR_CREATE_MARK_AS_PRIMARY (1 << 0)
92 #define INDEX_CONSTR_CREATE_DEFERRABLE (1 << 1)
93 #define INDEX_CONSTR_CREATE_INIT_DEFERRED (1 << 2)
94 #define INDEX_CONSTR_CREATE_UPDATE_INDEX (1 << 3)
95 #define INDEX_CONSTR_CREATE_REMOVE_OLD_DEPS (1 << 4)
96 #define INDEX_CONSTR_CREATE_WITHOUT_OVERLAPS (1 << 5)
101 const char *newName);
104 Oid indexRelationId);
108 const char *oldName);
115 Oid parentConstraintId,
117 const char *constraintName,
120 bool allow_system_table_mods,
123 extern void index_drop(
Oid indexId,
bool concurrent,
bool concurrent_lock_mode);
130 const Oid *collations1,
const Oid *collations2,
131 const Oid *opfamilies1,
const Oid *opfamilies2,
155 bool skip_constraint_checks,
char persistence,
159 #define REINDEX_REL_PROCESS_TOAST 0x01
160 #define REINDEX_REL_SUPPRESS_INDEX_USE 0x02
161 #define REINDEX_REL_CHECK_CONSTRAINTS 0x04
162 #define REINDEX_REL_FORCE_INDEXES_UNLOGGED 0x08
163 #define REINDEX_REL_FORCE_INDEXES_PERMANENT 0x10
202 encoded = ((uint64) block << 16) | (
uint16) offset;
static Datum values[MAXATTR]
bool ReindexIsProcessingIndex(Oid indexOid)
void validate_index(Oid heapId, Oid indexId, Snapshot snapshot)
void index_drop(Oid indexId, bool concurrent, bool concurrent_lock_mode)
void ResetReindexState(int nestLevel)
Oid IndexGetRelation(Oid indexId, bool missing_ok)
struct ValidateIndexState ValidateIndexState
void index_concurrently_set_dead(Oid heapId, Oid indexId)
Oid index_create(Relation heapRelation, const char *indexRelationName, Oid indexRelationId, Oid parentIndexRelid, Oid parentConstraintId, RelFileNumber relFileNumber, IndexInfo *indexInfo, const List *indexColNames, Oid accessMethodId, Oid tableSpaceId, const Oid *collationIds, const Oid *opclassIds, const Datum *opclassOptions, const int16 *coloptions, const NullableDatum *stattargets, Datum reloptions, bits16 flags, bits16 constr_flags, bool allow_system_table_mods, bool is_internal, Oid *constraintId)
void index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
static void itemptr_decode(ItemPointer itemptr, int64 encoded)
void index_set_state_flags(Oid indexId, IndexStateFlagsAction action)
bool CompareIndexInfo(const IndexInfo *info1, const IndexInfo *info2, const Oid *collations1, const Oid *collations2, const Oid *opfamilies1, const Oid *opfamilies2, const AttrMap *attmap)
IndexInfo * BuildDummyIndexInfo(Relation index)
bool reindex_relation(const ReindexStmt *stmt, Oid relid, int flags, const ReindexParams *params)
static int64 itemptr_encode(ItemPointer itemptr)
void IndexSetParentIndex(Relation partitionIdx, Oid parentOid)
void SerializeReindexState(Size maxsize, char *start_address)
Oid index_concurrently_create_copy(Relation heapRelation, Oid oldIndexId, Oid tablespaceOid, const char *newName)
void BuildSpeculativeIndexInfo(Relation index, IndexInfo *ii)
void index_check_primary_key(Relation heapRel, const IndexInfo *indexInfo, bool is_alter_table, const IndexStmt *stmt)
bool ReindexIsProcessingHeap(Oid heapOid)
struct ReindexParams ReindexParams
void RestoreReindexState(const void *reindexstate)
void index_build(Relation heapRelation, Relation indexRelation, IndexInfo *indexInfo, bool isreindex, bool parallel)
ObjectAddress index_constraint_create(Relation heapRelation, Oid indexRelationId, Oid parentConstraintId, const IndexInfo *indexInfo, const char *constraintName, char constraintType, bits16 constr_flags, bool allow_system_table_mods, bool is_internal)
void FormIndexDatum(IndexInfo *indexInfo, TupleTableSlot *slot, EState *estate, Datum *values, bool *isnull)
void index_concurrently_build(Oid heapRelationId, Oid indexRelationId)
Size EstimateReindexStateSpace(void)
IndexInfo * BuildIndexInfo(Relation index)
void reindex_index(const ReindexStmt *stmt, Oid indexId, bool skip_constraint_checks, char persistence, const ReindexParams *params)
static void ItemPointerSet(ItemPointerData *pointer, BlockNumber blockNumber, OffsetNumber offNum)
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
Tuplesortstate * tuplesort