File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 6565#include "access/relscan.h"
6666#include "access/transam.h"
6767#include "access/xact.h"
68+ #include "catalog/index.h"
6869#include "pgstat.h"
6970#include "storage/bufmgr.h"
7071#include "storage/lmgr.h"
7677
7778/* ----------------------------------------------------------------
7879 * macros used in index_ routines
80+ *
81+ * Note: the ReindexIsProcessingIndex() check in RELATION_CHECKS is there
82+ * to check that we don't try to scan or do retail insertions into an index
83+ * that is currently being rebuilt or pending rebuild. This helps to catch
84+ * things that don't work when reindexing system catalogs. The assertion
85+ * doesn't prevent the actual rebuild because we don't use RELATION_CHECKS
86+ * when calling the index AM's ambuild routine, and there is no reason for
87+ * ambuild to call its subsidiary routines through this file.
7988 * ----------------------------------------------------------------
8089 */
8190#define RELATION_CHECKS \
8291( \
8392 AssertMacro(RelationIsValid(indexRelation)), \
84- AssertMacro(PointerIsValid(indexRelation->rd_am)) \
93+ AssertMacro(PointerIsValid(indexRelation->rd_am)), \
94+ AssertMacro(!ReindexIsProcessingIndex(RelationGetRelid(indexRelation))) \
8595)
8696
8797#define SCAN_CHECKS \
You can’t perform that action at this time.
0 commit comments