| 2240 | } |
| 2241 | |
| 2242 | static Oid |
| 2243 | findTypeSendFunction(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 | |
| 2277 | static Oid |
| 2278 | findTypeTypmodinFunction(List *procname) |
no test coverage detected