@@ -1932,19 +1932,19 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
19321932}
19331933
19341934/*
1935- *LookupFuncNameTypeNames
1935+ *LookupFuncWithArgs
19361936 *Like LookupFuncName, but the argument types are specified by a
1937- *list of TypeName nodes .
1937+ *ObjectWithArgs node .
19381938 */
19391939Oid
1940- LookupFuncNameTypeNames ( List * funcname , List * argtypes ,bool noError )
1940+ LookupFuncWithArgs ( ObjectWithArgs * func ,bool noError )
19411941{
19421942Oid argoids [FUNC_MAX_ARGS ];
19431943int argcount ;
19441944int i ;
19451945ListCell * args_item ;
19461946
1947- argcount = list_length (argtypes );
1947+ argcount = list_length (func -> objargs );
19481948if (argcount > FUNC_MAX_ARGS )
19491949ereport (ERROR ,
19501950(errcode (ERRCODE_TOO_MANY_ARGUMENTS ),
@@ -1953,7 +1953,7 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError)
19531953FUNC_MAX_ARGS ,
19541954FUNC_MAX_ARGS )));
19551955
1956- args_item = list_head (argtypes );
1956+ args_item = list_head (func -> objargs );
19571957for (i = 0 ;i < argcount ;i ++ )
19581958{
19591959TypeName * t = (TypeName * )lfirst (args_item );
@@ -1962,19 +1962,19 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError)
19621962args_item = lnext (args_item );
19631963}
19641964
1965- return LookupFuncName (funcname ,argcount ,argoids ,noError );
1965+ return LookupFuncName (func -> objname ,argcount ,argoids ,noError );
19661966}
19671967
19681968/*
1969- *LookupAggNameTypeNames
1970- *Find an aggregate functiongiven aname and list of TypeName nodes .
1969+ *LookupAggWithArgs
1970+ *Find an aggregate functionfrom agiven ObjectWithArgs node .
19711971 *
1972- * This is almost likeLookupFuncNameTypeNames , but the error messages refer
1972+ * This is almost likeLookupFuncWithArgs , but the error messages refer
19731973 * to aggregates rather than plain functions, and we verify that the found
19741974 * function really is an aggregate.
19751975 */
19761976Oid
1977- LookupAggNameTypeNames ( List * aggname , List * argtypes ,bool noError )
1977+ LookupAggWithArgs ( ObjectWithArgs * agg ,bool noError )
19781978{
19791979Oid argoids [FUNC_MAX_ARGS ];
19801980int argcount ;
@@ -1984,7 +1984,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
19841984HeapTuple ftup ;
19851985Form_pg_proc pform ;
19861986
1987- argcount = list_length (argtypes );
1987+ argcount = list_length (agg -> objargs );
19881988if (argcount > FUNC_MAX_ARGS )
19891989ereport (ERROR ,
19901990(errcode (ERRCODE_TOO_MANY_ARGUMENTS ),
@@ -1994,15 +1994,15 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
19941994FUNC_MAX_ARGS )));
19951995
19961996i = 0 ;
1997- foreach (lc ,argtypes )
1997+ foreach (lc ,agg -> objargs )
19981998{
19991999TypeName * t = (TypeName * )lfirst (lc );
20002000
20012001argoids [i ]= LookupTypeNameOid (NULL ,t ,noError );
20022002i ++ ;
20032003}
20042004
2005- oid = LookupFuncName (aggname ,argcount ,argoids , true);
2005+ oid = LookupFuncName (agg -> objname ,argcount ,argoids , true);
20062006
20072007if (!OidIsValid (oid ))
20082008{
@@ -2012,12 +2012,12 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
20122012ereport (ERROR ,
20132013(errcode (ERRCODE_UNDEFINED_FUNCTION ),
20142014errmsg ("aggregate %s(*) does not exist" ,
2015- NameListToString (aggname ))));
2015+ NameListToString (agg -> objname ))));
20162016else
20172017ereport (ERROR ,
20182018(errcode (ERRCODE_UNDEFINED_FUNCTION ),
20192019errmsg ("aggregate %s does not exist" ,
2020- func_signature_string (aggname ,argcount ,
2020+ func_signature_string (agg -> objname ,argcount ,
20212021NIL ,argoids ))));
20222022}
20232023
@@ -2036,7 +2036,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
20362036ereport (ERROR ,
20372037(errcode (ERRCODE_WRONG_OBJECT_TYPE ),
20382038errmsg ("function %s is not an aggregate" ,
2039- func_signature_string (aggname ,argcount ,
2039+ func_signature_string (agg -> objname ,argcount ,
20402040NIL ,argoids ))));
20412041}
20422042