Commit bdc643e5 authored by Tom Lane's avatar Tom Lane

Fix access to just-closed relcache entry.

It might be impossible for this to cause a problem in non-debug builds,
since there'd be no opportunity for the relcache entry to get recycled
before the fetch.  It blows up nicely with -DRELCACHE_FORCE_RELEASE plus
valgrind, though.

Evidently introduced by careless refactoring in commit f0e44751.
Back-patch accordingly.

Discussion: https://postgr.es/m/27543.1528758304@sss.pgh.pa.us
parent f8795d2e
......@@ -11922,12 +11922,12 @@ ATExecDropInherit(Relation rel, RangeVar *parent, LOCKMODE lockmode)
/* Off to RemoveInheritance() where most of the work happens */
RemoveInheritance(rel, parent_rel);
/* keep our lock on the parent relation until commit */
heap_close(parent_rel, NoLock);
ObjectAddressSet(address, RelationRelationId,
RelationGetRelid(parent_rel));
/* keep our lock on the parent relation until commit */
heap_close(parent_rel, NoLock);
return address;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment