| 2343 | } |
| 2344 | |
| 2345 | static Oid |
| 2346 | findTypeAnalyzeFunction(List *procname, Oid typeOid) |
| 2347 | { |
| 2348 | Oid argList[1]; |
| 2349 | Oid procOid; |
| 2350 | |
| 2351 | /* |
| 2352 | * Analyze functions always take one INTERNAL argument and return bool. |
| 2353 | */ |
| 2354 | argList[0] = INTERNALOID; |
| 2355 | |
| 2356 | procOid = LookupFuncName(procname, 1, argList, true); |
| 2357 | if (!OidIsValid(procOid)) |
| 2358 | ereport(ERROR, |
| 2359 | (errcode(ERRCODE_UNDEFINED_FUNCTION), |
| 2360 | errmsg("function %s does not exist", |
| 2361 | func_signature_string(procname, 1, NIL, argList)))); |
| 2362 | |
| 2363 | if (get_func_rettype(procOid) != BOOLOID) |
| 2364 | ereport(ERROR, |
| 2365 | (errcode(ERRCODE_INVALID_OBJECT_DEFINITION), |
| 2366 | errmsg("type analyze function %s must return type %s", |
| 2367 | NameListToString(procname), "boolean"))); |
| 2368 | |
| 2369 | return procOid; |
| 2370 | } |
| 2371 | |
| 2372 | static Oid |
| 2373 | findTypeSubscriptingFunction(List *procname, Oid typeOid) |
no test coverage detected