diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index e9da06a9fa..4448b986b6 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2960,8 +2960,11 @@ ReindexRelationConcurrently(Oid relationOid, int options) indexId, concurrentName); - /* Now open the relation of the new index, a lock is also needed on it */ - newIndexRel = index_open(indexId, ShareUpdateExclusiveLock); + /* + * Now open the relation of the new index, a session-level lock is + * also needed on it. + */ + newIndexRel = index_open(newIndexId, ShareUpdateExclusiveLock); /* * Save the list of OIDs and locks in private context