This very small patch removes some duplicated code in pg_publication.
--
Álvaro Herrera http://www.linkedin.com/in/alvherre
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index d442c8e0bb..347324f320 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -403,17 +403,9 @@ GetPublicationByName(const char *pubname, bool missing_ok)
{
Oid oid;
- oid = GetSysCacheOid1(PUBLICATIONNAME, Anum_pg_publication_oid,
- CStringGetDatum(pubname));
- if (!OidIsValid(oid))
- {
- if (missing_ok)
- return NULL;
-
- ereport(ERROR,
- (errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("publication \"%s\" does not exist", pubname)));
- }
+ oid = get_publication_oid(pubname, missing_ok);
+ if (!OidIsValid(oid) && missing_ok)
+ return NULL;
return GetPublication(oid);
}