Content-Length: 276396 | pFad | http://github.com/postgrespro/postgres/commit/4ee5c40b06f098910ed0fc5fd72fb2744776ccbb

19 Don't try to use a unopened relation · postgrespro/postgres@4ee5c40 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/4ee5c40b06f098910ed0fc5fd72fb2744776ccbb

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy