Skip to content

Commit 4ee5c40

Browse files
committed
Don't try to use a unopened relation
Commit 4c9d090 mistakenly introduced a call to TransferPredicateLocksToHeapRelation() on an index relation that had been closed a few lines above. Moving up an index_open() call that's below is enough to fix the problem. Discovered by me while testing an unrelated patch.
1 parent c90dcd6 commit 4ee5c40

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/catalog/index.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,6 +1475,8 @@ index_drop(Oid indexId, bool concurrent)
14751475
* conflicts with existing predicate locks, so now is the time to move
14761476
* them to the heap relation.
14771477
*/
1478+
userHeapRelation = heap_open(heapId, ShareUpdateExclusiveLock);
1479+
userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock);
14781480
TransferPredicateLocksToHeapRelation(userIndexRelation);
14791481

14801482
/*
@@ -1484,9 +1486,6 @@ index_drop(Oid indexId, bool concurrent)
14841486
*/
14851487
indexRelation = heap_open(IndexRelationId, RowExclusiveLock);
14861488

1487-
userHeapRelation = heap_open(heapId, ShareUpdateExclusiveLock);
1488-
userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock);
1489-
14901489
tuple = SearchSysCacheCopy1(INDEXRELID,
14911490
ObjectIdGetDatum(indexId));
14921491
if (!HeapTupleIsValid(tuple))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy