Move funcid_get_rettype() to lsyscache.
authorTom Lane
Mon, 16 Aug 1999 02:08:59 +0000 (02:08 +0000)
committerTom Lane
Mon, 16 Aug 1999 02:08:59 +0000 (02:08 +0000)
src/backend/parser/parse_func.c

index 65f177885d4349d4744770e2332938120531dfbd..344c87920bc7d585286adb1a6c3420d3f25a549f 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.51 1999/08/05 02:33:54 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.52 1999/08/16 02:08:59 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -52,7 +52,6 @@ func_get_detail(char *funcname,
                Oid *rettype,   /* return value */
                bool *retset,   /* return value */
                Oid **true_typeids);
-static Oid funcid_get_rettype(Oid funcid);
 static Oid **gen_cross_product(InhPaths *arginh, int nargs);
 static void make_arguments(ParseState *pstate,
               int nargs,
@@ -629,25 +628,6 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
    return retval;
 }
 
-static Oid
-funcid_get_rettype(Oid funcid)
-{
-   HeapTuple   func_tuple = NULL;
-   Oid         funcrettype = InvalidOid;
-
-   func_tuple = SearchSysCacheTuple(PROOID,
-                                    ObjectIdGetDatum(funcid),
-                                    0, 0, 0);
-
-   if (!HeapTupleIsValid(func_tuple))
-       elog(ERROR, "Function OID %u does not exist", funcid);
-
-   funcrettype = (Oid)
-       ((Form_pg_proc) GETSTRUCT(func_tuple))->prorettype;
-
-   return funcrettype;
-}
-
 
 /* func_get_candidates()
  * get a list of all argument type vectors for which a function named
@@ -1378,7 +1358,7 @@ ParseComplexProjection(ParseState *pstate,
 
                iter = (Iter *) first_arg;
                func = (Func *) ((Expr *) iter->iterexpr)->oper;
-               argtype = funcid_get_rettype(func->funcid);
+               argtype = get_func_rettype(func->funcid);
                argrelid = typeidTypeRelid(argtype);
                if (argrelid &&
                    ((attnum = get_attnum(argrelid, funcname))
@@ -1435,7 +1415,7 @@ ParseComplexProjection(ParseState *pstate,
                    break;
 
                funcnode = (Func *) expr->oper;
-               argtype = funcid_get_rettype(funcnode->funcid);
+               argtype = get_func_rettype(funcnode->funcid);
                argrelid = typeidTypeRelid(argtype);
 
                /*