PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ expandFunctionOid()

static Oid expandFunctionOid ( Oid  geotype,
Oid  callingfunc 
)
static

Definition at line 280 of file gserialized_supportfn.c.

281 {
282  const Oid radiustype = FLOAT8OID; /* Should always be FLOAT8OID */
283  const Oid expandfn_args[2] = {geotype, radiustype};
284  const bool noError = true;
285  /* Expand function must be in same namespace as the caller */
286  char *nspname = get_namespace_name(get_func_namespace(callingfunc));
287  List *expandfn_name = list_make2(makeString(nspname), makeString("st_expand"));
288  Oid expandfn_oid = LookupFuncName(expandfn_name, 2, expandfn_args, noError);
289  if (expandfn_oid == InvalidOid)
290  {
291  /*
292  * This is ugly, but we first lookup the geometry variant of expand
293  * and if we fail, we look up the geography variant. The alternative
294  * is re-naming the geography variant to match the geometry
295  * one, which would not be the end of the world.
296  */
297  expandfn_name = list_make2(makeString(nspname), makeString("_st_expand"));
298  expandfn_oid = LookupFuncName(expandfn_name, 2, expandfn_args, noError);
299  if (expandfn_oid == InvalidOid)
300  elog(ERROR, "%s: unable to lookup 'st_expand(Oid[%u], Oid[%u])'", __func__, geotype, radiustype);
301  }
302  return expandfn_oid;
303 }

Referenced by postgis_index_supportfn().

Here is the caller graph for this function: