PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ expandFunctionOid()

static Oid expandFunctionOid ( Oid  geotype,
Oid  callingfunc 
)
static

Definition at line 278 of file gserialized_supportfn.c.

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

Referenced by postgis_index_supportfn().

Here is the caller graph for this function: