mirror of
https://github.com/postgres/postgres.git
synced 2025-11-22 12:22:45 +03:00
Support use of function argument names to identify which actual arguments
match which function parameters. The syntax uses AS, for example funcname(value AS arg1, anothervalue AS arg2) Pavel Stehule
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.102 2009/06/11 14:48:55 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_aggregate.c,v 1.103 2009/10/08 02:39:18 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -321,7 +321,8 @@ lookup_agg_function(List *fnName,
|
||||
* function's return value. it also returns the true argument types to
|
||||
* the function.
|
||||
*/
|
||||
fdresult = func_get_detail(fnName, NIL, nargs, input_types, false, false,
|
||||
fdresult = func_get_detail(fnName, NIL, NIL,
|
||||
nargs, input_types, false, false,
|
||||
&fnOid, rettype, &retset, &nvargs,
|
||||
&true_oid_array, NULL);
|
||||
|
||||
@@ -330,12 +331,14 @@ lookup_agg_function(List *fnName,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||
errmsg("function %s does not exist",
|
||||
func_signature_string(fnName, nargs, input_types))));
|
||||
func_signature_string(fnName, nargs,
|
||||
NIL, input_types))));
|
||||
if (retset)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("function %s returns a set",
|
||||
func_signature_string(fnName, nargs, input_types))));
|
||||
func_signature_string(fnName, nargs,
|
||||
NIL, input_types))));
|
||||
|
||||
/*
|
||||
* If there are any polymorphic types involved, enforce consistency, and
|
||||
@@ -359,7 +362,8 @@ lookup_agg_function(List *fnName,
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATATYPE_MISMATCH),
|
||||
errmsg("function %s requires run-time type coercion",
|
||||
func_signature_string(fnName, nargs, true_oid_array))));
|
||||
func_signature_string(fnName, nargs,
|
||||
NIL, true_oid_array))));
|
||||
}
|
||||
|
||||
/* Check aggregate creator has permission to call the function */
|
||||
|
||||
Reference in New Issue
Block a user