@@ -1462,13 +1462,6 @@ index_build(Relation heapRelation,
1462
1462
HeapTuple indexTuple ;
1463
1463
Form_pg_index indexForm ;
1464
1464
1465
- /*
1466
- * Broken HOT chains should not get reported in system catalogs; in
1467
- * particular it would be quite dangerous to try to modify the index's
1468
- * pg_index entry if we are reindexing pg_index itself.
1469
- */
1470
- Assert (!IsSystemRelation (heapRelation ));
1471
-
1472
1465
pg_index = heap_open (IndexRelationId , RowExclusiveLock );
1473
1466
1474
1467
indexTuple = SearchSysCacheCopy1 (INDEXRELID ,
@@ -1528,13 +1521,7 @@ index_build(Relation heapRelation,
1528
1521
* A side effect is to set indexInfo->ii_BrokenHotChain to true if we detect
1529
1522
* any potentially broken HOT chains. Currently, we set this if there are
1530
1523
* any RECENTLY_DEAD entries in a HOT chain, without trying very hard to
1531
- * detect whether they're really incompatible with the chain tip. However,
1532
- * we do not ever set ii_BrokenHotChain true when the relation is a system
1533
- * catalog. This is to avoid problematic behavior when reindexing pg_index
1534
- * itself: we can't safely change the index's indcheckxmin field when we're
1535
- * partway through such an operation. It should be okay since the set of
1536
- * indexes on a system catalog ought not change during concurrent operations,
1537
- * so that no HOT chain in it could ever become broken.
1524
+ * detect whether they're really incompatible with the chain tip.
1538
1525
*/
1539
1526
double
1540
1527
IndexBuildHeapScan (Relation heapRelation ,
@@ -1711,8 +1698,7 @@ IndexBuildHeapScan(Relation heapRelation,
1711
1698
{
1712
1699
indexIt = false;
1713
1700
/* mark the index as unsafe for old snapshots */
1714
- if (!is_system_catalog )
1715
- indexInfo -> ii_BrokenHotChain = true;
1701
+ indexInfo -> ii_BrokenHotChain = true;
1716
1702
}
1717
1703
else if (indexInfo -> ii_BrokenHotChain )
1718
1704
indexIt = false;
@@ -1800,8 +1786,7 @@ IndexBuildHeapScan(Relation heapRelation,
1800
1786
{
1801
1787
indexIt = false;
1802
1788
/* mark the index as unsafe for old snapshots */
1803
- if (!is_system_catalog )
1804
- indexInfo -> ii_BrokenHotChain = true;
1789
+ indexInfo -> ii_BrokenHotChain = true;
1805
1790
}
1806
1791
else if (indexInfo -> ii_BrokenHotChain )
1807
1792
indexIt = false;
@@ -2496,13 +2481,8 @@ reindex_index(Oid indexId, bool skip_constraint_checks)
2496
2481
* We can also reset indcheckxmin, because we have now done a
2497
2482
* non-concurrent index build, *except* in the case where index_build
2498
2483
* found some still-broken HOT chains.
2499
- *
2500
- * When reindexing a system catalog, don't do any of this --- it would be
2501
- * particularly risky to try to modify pg_index while we are reindexing
2502
- * pg_index itself. We don't support CREATE INDEX CONCURRENTLY on system
2503
- * catalogs anyway, and they should never have indcheckxmin set either.
2504
2484
*/
2505
- if (!skipped_constraint && ! IsSystemRelation ( heapRelation ) )
2485
+ if (!skipped_constraint )
2506
2486
{
2507
2487
pg_index = heap_open (IndexRelationId , RowExclusiveLock );
2508
2488
0 commit comments