@@ -1932,19 +1932,19 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
1932
1932
}
1933
1933
1934
1934
/*
1935
- * LookupFuncNameTypeNames
1935
+ * LookupFuncWithArgs
1936
1936
* Like LookupFuncName, but the argument types are specified by a
1937
- * list of TypeName nodes .
1937
+ * ObjectWithArgs node .
1938
1938
*/
1939
1939
Oid
1940
- LookupFuncNameTypeNames ( List * funcname , List * argtypes , bool noError )
1940
+ LookupFuncWithArgs ( ObjectWithArgs * func , bool noError )
1941
1941
{
1942
1942
Oid argoids [FUNC_MAX_ARGS ];
1943
1943
int argcount ;
1944
1944
int i ;
1945
1945
ListCell * args_item ;
1946
1946
1947
- argcount = list_length (argtypes );
1947
+ argcount = list_length (func -> objargs );
1948
1948
if (argcount > FUNC_MAX_ARGS )
1949
1949
ereport (ERROR ,
1950
1950
(errcode (ERRCODE_TOO_MANY_ARGUMENTS ),
@@ -1953,7 +1953,7 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError)
1953
1953
FUNC_MAX_ARGS ,
1954
1954
FUNC_MAX_ARGS )));
1955
1955
1956
- args_item = list_head (argtypes );
1956
+ args_item = list_head (func -> objargs );
1957
1957
for (i = 0 ; i < argcount ; i ++ )
1958
1958
{
1959
1959
TypeName * t = (TypeName * ) lfirst (args_item );
@@ -1962,19 +1962,19 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool noError)
1962
1962
args_item = lnext (args_item );
1963
1963
}
1964
1964
1965
- return LookupFuncName (funcname , argcount , argoids , noError );
1965
+ return LookupFuncName (func -> objname , argcount , argoids , noError );
1966
1966
}
1967
1967
1968
1968
/*
1969
- * LookupAggNameTypeNames
1970
- * Find an aggregate function given a name and list of TypeName nodes .
1969
+ * LookupAggWithArgs
1970
+ * Find an aggregate function from a given ObjectWithArgs node .
1971
1971
*
1972
- * This is almost like LookupFuncNameTypeNames , but the error messages refer
1972
+ * This is almost like LookupFuncWithArgs , but the error messages refer
1973
1973
* to aggregates rather than plain functions, and we verify that the found
1974
1974
* function really is an aggregate.
1975
1975
*/
1976
1976
Oid
1977
- LookupAggNameTypeNames ( List * aggname , List * argtypes , bool noError )
1977
+ LookupAggWithArgs ( ObjectWithArgs * agg , bool noError )
1978
1978
{
1979
1979
Oid argoids [FUNC_MAX_ARGS ];
1980
1980
int argcount ;
@@ -1984,7 +1984,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
1984
1984
HeapTuple ftup ;
1985
1985
Form_pg_proc pform ;
1986
1986
1987
- argcount = list_length (argtypes );
1987
+ argcount = list_length (agg -> objargs );
1988
1988
if (argcount > FUNC_MAX_ARGS )
1989
1989
ereport (ERROR ,
1990
1990
(errcode (ERRCODE_TOO_MANY_ARGUMENTS ),
@@ -1994,15 +1994,15 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
1994
1994
FUNC_MAX_ARGS )));
1995
1995
1996
1996
i = 0 ;
1997
- foreach (lc , argtypes )
1997
+ foreach (lc , agg -> objargs )
1998
1998
{
1999
1999
TypeName * t = (TypeName * ) lfirst (lc );
2000
2000
2001
2001
argoids [i ] = LookupTypeNameOid (NULL , t , noError );
2002
2002
i ++ ;
2003
2003
}
2004
2004
2005
- oid = LookupFuncName (aggname , argcount , argoids , true);
2005
+ oid = LookupFuncName (agg -> objname , argcount , argoids , true);
2006
2006
2007
2007
if (!OidIsValid (oid ))
2008
2008
{
@@ -2012,12 +2012,12 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
2012
2012
ereport (ERROR ,
2013
2013
(errcode (ERRCODE_UNDEFINED_FUNCTION ),
2014
2014
errmsg ("aggregate %s(*) does not exist" ,
2015
- NameListToString (aggname ))));
2015
+ NameListToString (agg -> objname ))));
2016
2016
else
2017
2017
ereport (ERROR ,
2018
2018
(errcode (ERRCODE_UNDEFINED_FUNCTION ),
2019
2019
errmsg ("aggregate %s does not exist" ,
2020
- func_signature_string (aggname , argcount ,
2020
+ func_signature_string (agg -> objname , argcount ,
2021
2021
NIL , argoids ))));
2022
2022
}
2023
2023
@@ -2036,7 +2036,7 @@ LookupAggNameTypeNames(List *aggname, List *argtypes, bool noError)
2036
2036
ereport (ERROR ,
2037
2037
(errcode (ERRCODE_WRONG_OBJECT_TYPE ),
2038
2038
errmsg ("function %s is not an aggregate" ,
2039
- func_signature_string (aggname , argcount ,
2039
+ func_signature_string (agg -> objname , argcount ,
2040
2040
NIL , argoids ))));
2041
2041
}
2042
2042
0 commit comments