/* Hash table for caching the results of shippability lookups */ static HTAB *ShippableCacheHash = NULL;
/* *Hashkeyforshippabilitylookups.WeincludetheFDWserverOIDbecause *decisionsmaydifferper-server.Otherwise,objectsareidentifiedby *their(local!)OIDandcatalogOID.
*/ typedefstruct
{ /* XXX we assume this struct contains no padding bytes */
Oid objid; /* function/operator/type OID */
Oid classid; /* OID of its catalog (pg_proc, etc) */
Oid serverid; /* FDW server we are concerned with */
} ShippableCacheKey;
typedefstruct
{
ShippableCacheKey key; /* hash key - must be first */ bool shippable;
} ShippableCacheEntry;
/* Set up invalidation callback on pg_foreign_server. */
CacheRegisterSyscacheCallback(FOREIGNSERVEROID,
InvalidateShippableCacheCallback,
(Datum) 0);
}
/* *Returnstrueifgivenobject(operator/function/type)isshippable *accordingtotheserveroptions. * *Rightnow"shippability"isexclusivelyafunctionofwhethertheobject *belongstoanextensiondeclaredbytheuser.Inthefuturewecould *additionallyhavealistoffunctions/operatorsdeclaredoneatatime.
*/ staticbool
lookup_shippable(Oid objectId, Oid classId, PgFdwRelationInfo *fpinfo)
{
Oid extensionOid;
/* If so, is that extension in fpinfo->shippable_extensions? */ if (OidIsValid(extensionOid) &&
list_member_oid(fpinfo->shippable_extensions, extensionOid)) returntrue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.