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_2_BETA1~1302 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5057366eedaccef1f4c25a7c5de0d6c1c5a291f1;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 8de5bec57a1..7f16212c9e5 100644 --- a/src/backend/catalog/objectaddress.c +++ b/src/backend/catalog/objectaddress.c @@ -498,6 +498,12 @@ get_object_address_relobject(ObjectType objtype, List *objname, 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 {