check_object_ownership() isn't happy about the null relation pointer.
We could fix it there, but this seems more future-proof.
address.objectId =
get_rewrite_oid_without_relid(depname, &reloid, missing_ok);
address.objectSubId = 0;
+
+ /*
+ * Caller is expecting to get back the relation, even though we
+ * didn't end up using it to find the rule.
+ */
+ relation = heap_open(reloid, AccessShareLock);
}
else
{