This function checks for error conditions in lapply() function calls. */
| 1770 | /* This function checks for error conditions in lapply() function calls. |
| 1771 | */ |
| 1772 | static bool lapply_error_checking(Oid foid, List * func) { |
| 1773 | /* foid != InvalidOid; otherwise LookupFuncName would raise error. |
| 1774 | Here we check that the return type of foid is float8. */ |
| 1775 | HeapTuple ftup = SearchSysCache(PROCOID, |
| 1776 | ObjectIdGetDatum(foid), 0, 0, 0); |
| 1777 | Form_pg_proc pform = (Form_pg_proc) GETSTRUCT(ftup); |
| 1778 | |
| 1779 | if (pform->prorettype != FLOAT8OID) |
| 1780 | ereport(ERROR, |
| 1781 | (errcode(ERRCODE_DATATYPE_MISMATCH), |
| 1782 | errmsg("return type of %s is not double", |
| 1783 | NameListToString(func)))); |
| 1784 | |
| 1785 | // check volatility |
| 1786 | |
| 1787 | ReleaseSysCache(ftup); |
| 1788 | return true; |
| 1789 | } |
| 1790 |