diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/index.h | 9 | ||||
| -rw-r--r-- | src/include/catalog/pg_index.h | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index 9728d791b6a..a2381b1e5d4 100644 --- a/src/include/catalog/index.h +++ b/src/include/catalog/index.h @@ -27,6 +27,13 @@ typedef void (*IndexBuildCallback) (Relation index, bool tupleIsAlive, void *state); +/* Action code for index_set_state_flags */ +typedef enum +{ + INDEX_CREATE_SET_READY, + INDEX_CREATE_SET_VALID +} IndexStateFlagsAction; + extern Oid index_create(Oid heapRelationId, const char *indexRelationName, @@ -71,6 +78,8 @@ extern double IndexBuildHeapScan(Relation heapRelation, extern void validate_index(Oid heapId, Oid indexId, Snapshot snapshot); +extern void index_set_state_flags(Oid indexId, IndexStateFlagsAction action); + extern void reindex_index(Oid indexId, bool skip_constraint_checks); #define REINDEX_CHECK_CONSTRAINTS 0x1 diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h index 685fae3c0e7..2fe179a0cb8 100644 --- a/src/include/catalog/pg_index.h +++ b/src/include/catalog/pg_index.h @@ -88,4 +88,12 @@ typedef FormData_pg_index *Form_pg_index; #define INDOPTION_DESC 0x0001 /* values are in reverse order */ #define INDOPTION_NULLS_FIRST 0x0002 /* NULLs are first instead of last */ +/* + * Use of these macros is recommended over direct examination of the state + * flag columns where possible; this allows source code compatibility with + * 9.2 and up. + */ +#define IndexIsValid(indexForm) ((indexForm)->indisvalid) +#define IndexIsReady(indexForm) ((indexForm)->indisready) + #endif /* PG_INDEX_H */ |
