index 5155a14342f63755797ee15e8d9060636a8effcf..2fa6d33535088ec2c0b149122f17f16f1649074a 100644 (file)
@@ -648,6 +648,9 @@ cache_record_field_properties(TypeCacheEntry *typentry)
load_typcache_tupdesc(typentry);
tupdesc = typentry->tupDesc;
+ /* Must bump the refcount while we do additional catalog lookups */
+ IncrTupleDescRefCount(tupdesc);
+
/* Have each property if all non-dropped fields have the property */
newflags = (TCFLAGS_HAVE_FIELD_EQUALITY |
TCFLAGS_HAVE_FIELD_COMPARE);
@@ -671,6 +674,8 @@ cache_record_field_properties(TypeCacheEntry *typentry)
break;
}
typentry->flags |= newflags;
+
+ DecrTupleDescRefCount(tupdesc);
}
typentry->flags |= TCFLAGS_CHECKED_FIELD_PROPERTIES;
}