]> granicus.if.org Git - postgresql/commitdiff
Unbreak legacy syntax "COMMENT ON RULE x IS y", with no relation name.
authorRobert Haas <rhaas@postgresql.org>
Thu, 11 Aug 2011 15:23:51 +0000 (11:23 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 11 Aug 2011 15:29:20 +0000 (11:29 -0400)
check_object_ownership() isn't happy about the null relation pointer.
We could fix it there, but this seems more future-proof.

src/backend/catalog/objectaddress.c

index bf25091582ff2be7bb6239c150c495065c00ceed..3925b8ec95c60255e9f7d4c81c9fde98a56b151d 100644 (file)
@@ -463,6 +463,11 @@ get_object_address_relobject(ObjectType objtype, List *objname, Relation *relp)
                address.classId = RewriteRelationId;
                address.objectId = get_rewrite_oid_without_relid(depname, &reloid);
                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