From: Robert Haas Date: Thu, 11 Aug 2011 15:23:51 +0000 (-0400) Subject: Unbreak legacy syntax "COMMENT ON RULE x IS y", with no relation name. X-Git-Tag: REL9_1_RC1~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a60c16db5f36562df571d36fcacbbed33fd40bd4;p=thirdparty%2Fpostgresql.git Unbreak legacy syntax "COMMENT ON RULE x IS y", with no relation name. check_object_ownership() isn't happy about the null relation pointer. We could fix it there, but this seems more future-proof. --- diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c index bf25091582f..3925b8ec95c 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -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