@@ -1770,13 +1770,6 @@ index_build(Relation heapRelation,
1770
1770
HeapTuple indexTuple ;
1771
1771
Form_pg_index indexForm ;
1772
1772
1773
- /*
1774
- * Broken HOT chains should not get reported in system catalogs; in
1775
- * particular it would be quite dangerous to try to modify the index's
1776
- * pg_index entry if we are reindexing pg_index itself.
1777
- */
1778
- Assert (!IsSystemRelation (heapRelation ));
1779
-
1780
1773
pg_index = heap_open (IndexRelationId ,RowExclusiveLock );
1781
1774
1782
1775
indexTuple = SearchSysCacheCopy1 (INDEXRELID ,
@@ -1834,13 +1827,7 @@ index_build(Relation heapRelation,
1834
1827
* A side effect is to set indexInfo->ii_BrokenHotChain to true if we detect
1835
1828
* any potentially broken HOT chains. Currently, we set this if there are
1836
1829
* any RECENTLY_DEAD entries in a HOT chain, without trying very hard to
1837
- * detect whether they're really incompatible with the chain tip. However,
1838
- * we do not ever set ii_BrokenHotChain true when the relation is a system
1839
- * catalog. This is to avoid problematic behavior when reindexing pg_index
1840
- * itself: we can't safely change the index's indcheckxmin field when we're
1841
- * partway through such an operation. It should be okay since the set of
1842
- * indexes on a system catalog ought not change during concurrent operations,
1843
- * so that no HOT chain in it could ever become broken.
1830
+ * detect whether they're really incompatible with the chain tip.
1844
1831
*/
1845
1832
double
1846
1833
IndexBuildHeapScan (Relation heapRelation ,
@@ -2017,8 +2004,7 @@ IndexBuildHeapScan(Relation heapRelation,
2017
2004
{
2018
2005
indexIt = false;
2019
2006
/* mark the index as unsafe for old snapshots */
2020
- if (!is_system_catalog )
2021
- indexInfo -> ii_BrokenHotChain = true;
2007
+ indexInfo -> ii_BrokenHotChain = true;
2022
2008
}
2023
2009
else if (indexInfo -> ii_BrokenHotChain )
2024
2010
indexIt = false;
@@ -2106,8 +2092,7 @@ IndexBuildHeapScan(Relation heapRelation,
2106
2092
{
2107
2093
indexIt = false;
2108
2094
/* mark the index as unsafe for old snapshots */
2109
- if (!is_system_catalog )
2110
- indexInfo -> ii_BrokenHotChain = true;
2095
+ indexInfo -> ii_BrokenHotChain = true;
2111
2096
}
2112
2097
else if (indexInfo -> ii_BrokenHotChain )
2113
2098
indexIt = false;
@@ -2802,13 +2787,8 @@ reindex_index(Oid indexId, bool skip_constraint_checks)
2802
2787
* We can also reset indcheckxmin, because we have now done a
2803
2788
* non-concurrent index build, *except* in the case where index_build
2804
2789
* found some still-broken HOT chains.
2805
- *
2806
- * When reindexing a system catalog, don't do any of this --- it would be
2807
- * particularly risky to try to modify pg_index while we are reindexing
2808
- * pg_index itself. We don't support CREATE INDEX CONCURRENTLY on system
2809
- * catalogs anyway, and they should never have indcheckxmin set either.
2810
2790
*/
2811
- if (!skipped_constraint && ! IsSystemRelation ( heapRelation ) )
2791
+ if (!skipped_constraint )
2812
2792
{
2813
2793
pg_index = heap_open (IndexRelationId ,RowExclusiveLock );
2814
2794