Commit 115cb315 authored by Peter Eisentraut's avatar Peter Eisentraut

Fix relcache leaks in get_object_address_publication_rel()

parent e35bbea7
......@@ -1835,7 +1835,10 @@ get_object_address_publication_rel(List *objname, List *objargs,
/* Now look up the pg_publication tuple */
pub = GetPublicationByName(pubname, missing_ok);
if (!pub)
{
relation_close(relation, AccessShareLock);
return address;
}
/* Find the publication relation mapping in syscache. */
address.objectId =
......@@ -1849,6 +1852,7 @@ get_object_address_publication_rel(List *objname, List *objargs,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("publication relation \"%s\" in publication \"%s\" does not exist",
RelationGetRelationName(relation), pubname)));
relation_close(relation, AccessShareLock);
return address;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment