aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/catalog/index.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index c48ad93e28b..78896da391b 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -1668,8 +1668,12 @@ index_concurrently_swap(Oid newIndexId, Oid oldIndexId, const char *oldName)
}
/*
- * Move all dependencies of and on the old index to the new one
+ * Move all dependencies of and on the old index to the new one. First
+ * remove any dependencies that the new index may have to provide an
+ * initial clean state for the dependency switch, and then move all the
+ * dependencies from the old index to the new one.
*/
+ deleteDependencyRecordsFor(RelationRelationId, newIndexId, false);
changeDependenciesOf(RelationRelationId, oldIndexId, newIndexId);
changeDependenciesOn(RelationRelationId, oldIndexId, newIndexId);