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

Function findTypeOutputFunction

src/backend/commands/typecmds.c:2153–2186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2151}
2152
2153static Oid
2154findTypeOutputFunction(List *procname, Oid typeOid)
2155{
2156 Oid argList[1];
2157 Oid procOid;
2158
2159 /*
2160 * Output functions always take a single argument of the type and return
2161 * cstring.
2162 */
2163 argList[0] = typeOid;
2164
2165 procOid = LookupFuncName(procname, 1, argList, true);
2166 if (!OidIsValid(procOid))
2167 ereport(ERROR,
2168 (errcode(ERRCODE_UNDEFINED_FUNCTION),
2169 errmsg("function %s does not exist",
2170 func_signature_string(procname, 1, NIL, argList))));
2171
2172 if (get_func_rettype(procOid) != CSTRINGOID)
2173 ereport(ERROR,
2174 (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2175 errmsg("type output function %s must return type %s",
2176 NameListToString(procname), "cstring")));
2177
2178 /* Just a warning for now, per comments in findTypeInputFunction */
2179 if (func_volatile(procOid) == PROVOLATILE_VOLATILE)
2180 ereport(WARNING,
2181 (errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
2182 errmsg("type output function %s should not be volatile",
2183 NameListToString(procname))));
2184
2185 return procOid;
2186}
2187
2188static Oid
2189findTypeReceiveFunction(List *procname, Oid typeOid)

Callers 1

DefineTypeFunction · 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