File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -374,7 +374,6 @@ GetPublication(Oid pubid)
374374 Form_pg_publication pubform ;
375375
376376 tup = SearchSysCache1 (PUBLICATIONOID , ObjectIdGetDatum (pubid ));
377-
378377 if (!HeapTupleIsValid (tup ))
379378 elog (ERROR , "cache lookup failed for publication %u" , pubid );
380379
@@ -403,19 +402,9 @@ GetPublicationByName(const char *pubname, bool missing_ok)
403402{
404403 Oid oid ;
405404
406- oid = GetSysCacheOid1 (PUBLICATIONNAME , Anum_pg_publication_oid ,
407- CStringGetDatum (pubname ));
408- if (!OidIsValid (oid ))
409- {
410- if (missing_ok )
411- return NULL ;
412-
413- ereport (ERROR ,
414- (errcode (ERRCODE_UNDEFINED_OBJECT ),
415- errmsg ("publication \"%s\" does not exist" , pubname )));
416- }
405+ oid = get_publication_oid (pubname , missing_ok );
417406
418- return GetPublication (oid );
407+ return OidIsValid ( oid ) ? GetPublication (oid ) : NULL ;
419408}
420409
421410/*
You can’t perform that action at this time.
0 commit comments