bugfix:can not delete a database with external tables

This commit is contained in:
chenlinfeng3
2020-07-29 14:19:10 +08:00
parent 597536b181
commit eaa8a9f93a

View File

@ -524,8 +524,7 @@ FdwRoutine* GetFdwRoutineByServerId(Oid serverid)
/* Get foreign-data wrapper OID for the server. */
tp = SearchSysCache1(FOREIGNSERVEROID, ObjectIdGetDatum(serverid));
if (!HeapTupleIsValid(tp))
ereport(ERROR, (errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("cache lookup failed for foreign server %u", serverid)));
return NULL;
serverform = (Form_pg_foreign_server) GETSTRUCT(tp);
fdwid = serverform->srvfdw;
ReleaseSysCache(tp);