aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2011-08-11 11:23:51 -0400
committerRobert Haas <rhaas@postgresql.org>2011-08-11 11:23:51 -0400
commit5057366eedaccef1f4c25a7c5de0d6c1c5a291f1 (patch)
treec4b89e824e51811e72fce0ba616abcf767758df8
parent59414cdedbc2ed418d66eddc0fcaf9dc40fbc27f (diff)
downloadpostgresql-5057366eedaccef1f4c25a7c5de0d6c1c5a291f1.tar.gz
postgresql-5057366eedaccef1f4c25a7c5de0d6c1c5a291f1.zip
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.
-rw-r--r--src/backend/catalog/objectaddress.c6
1 files changed, 6 insertions, 0 deletions
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
{