MCPcopy Create free account
hub / github.com/apache/cloudberry / findTypeSendFunction

Function findTypeSendFunction

src/backend/commands/typecmds.c:2242–2275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2240}
2241
2242static Oid
2243findTypeSendFunction(List *procname, Oid typeOid)
2244{
2245 Oid argList[1];
2246 Oid procOid;
2247
2248 /*
2249 * Send functions always take a single argument of the type and return
2250 * bytea.
2251 */
2252 argList[0] = typeOid;
2253
2254 procOid = LookupFuncName(procname, 1, argList, true);
2255 if (!OidIsValid(procOid))
2256 ereport(ERROR,
2257 (errcode(ERRCODE_UNDEFINED_FUNCTION),
2258 errmsg("function %s does not exist",
2259 func_signature_string(procname, 1, NIL, argList))));
2260
2261 if (get_func_rettype(procOid) != BYTEAOID)
2262 ereport(ERROR,
2263 (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2264 errmsg("type send function %s must return type %s",
2265 NameListToString(procname), "bytea")));
2266
2267 /* Just a warning for now, per comments in findTypeInputFunction */
2268 if (func_volatile(procOid) == PROVOLATILE_VOLATILE)
2269 ereport(WARNING,
2270 (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2271 errmsg("type send function %s should not be volatile",
2272 NameListToString(procname))));
2273
2274 return procOid;
2275}
2276
2277static Oid
2278findTypeTypmodinFunction(List *procname)

Callers 2

DefineTypeFunction · 0.85
AlterTypeFunction · 0.85

Calls 7

LookupFuncNameFunction · 0.85
func_signature_stringFunction · 0.85
get_func_rettypeFunction · 0.85
NameListToStringFunction · 0.85
func_volatileFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected