Hi,
Last time, I promise.

It's probably not happening, but it can happen, I think.

Best regards.
Ranier Vilela

--- \dll\postgresql-12.0\a\backend\access\brin\brin_validate.c  Mon Sep 30 
17:06:55 2019
+++ brin_validate.c     Fri Nov 15 08:14:58 2019
@@ -57,8 +57,10 @@
 
        /* Fetch opclass information */
        classtup = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclassoid));
-       if (!HeapTupleIsValid(classtup))
+       if (!HeapTupleIsValid(classtup)) {
                elog(ERROR, "cache lookup failed for operator class %u", 
opclassoid);
+        return false;
+    }
        classform = (Form_pg_opclass) GETSTRUCT(classtup);
 
        opfamilyoid = classform->opcfamily;
@@ -67,8 +69,11 @@
 
        /* Fetch opfamily information */
        familytup = SearchSysCache1(OPFAMILYOID, ObjectIdGetDatum(opfamilyoid));
-       if (!HeapTupleIsValid(familytup))
+       if (!HeapTupleIsValid(familytup)) {
                elog(ERROR, "cache lookup failed for operator family %u", 
opfamilyoid);
+           ReleaseSysCache(classtup);
+        return false;
+    }
        familyform = (Form_pg_opfamily) GETSTRUCT(familytup);
 
        opfamilyname = NameStr(familyform->opfname);

Attachment: brin_validate.c.patch
Description: brin_validate.c.patch

Reply via email to