8000 Don't try to use a unopened relation · danielcode/postgres@9eb80f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9eb80f2

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 663c68f commit 9eb80f2

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
@@ -1464,6 +1464,8 @@ index_drop(Oid indexId, bool concurrent)
14641464
* conflicts with existing predicate locks, so now is the time to move
14651465
* them to the heap relation.
14661466
*/
1467+
userHeapRelation = heap_open(heapId, ShareUpdateExclusiveLock);
1468+
userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock);
14671469
TransferPredicateLocksToHeapRelation(userIndexRelation);
14681470

14691471
/*
@@ -1473,9 +1475,6 @@ index_drop(Oid indexId, bool concurrent)
14731475
*/
14741476
indexRelation = heap_open(IndexRelationId, RowExclusiveLock);
14751477

1476-
userHeapRelation = heap_open(heapId, ShareUpdateExclusiveLock);
1477-
userIndexRelation = index_open(indexId, ShareUpdateExclusiveLock);
1478-
14791478
tuple = SearchSysCacheCopy1(INDEXRELID,
14801479
ObjectIdGetDatum(indexId));
14811480
if (!HeapTupleIsValid(tuple))

0 commit comments

Comments
 (0)
0