You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
RelationCacheInsert() ignored the possibility that hash_search(HASH_ENTER)might find a hashtable entry already present for the same OID. However,that can in fact occur during recursive relcache load scenarios. When itdid happen, we overwrote the pointer to the pre-existing Relation, causinga session-lifespan leakage of that entire structure. As far as is known,the pre-existing Relation would always have reference count zero by thetime we arrive back at the outer insertion, so add code that deletes thepre-existing Relation if so. If by some chance its refcount is positive,elog a WARNING and allow the pre-existing Relation to be leaked as before.Also, AttrDefaultFetch() was sloppy about leaking the cstring form of thepg_attrdef.adbin value it's copying into the relcache structure. This isonly a query-lifespan leakage, and normally not very significant, but itadds up during CLOBBER_CACHE testing.These bugs are of very ancient vintage, but I'll refrain from back-patchingsince there's no evidence that these leaks amount to anything in ordinaryusage.