summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_func.c
diff options
context:
space:
mode:
authorPeter Eisentraut2017-12-13 15:37:48 +0000
committerPeter Eisentraut2017-12-13 15:37:48 +0000
commit3d8874224ff25de3ca4f9da8ce3118391bd6609e (patch)
tree0033e373cf7c69ebc6308a21a33c1f27b303de0d /src/backend/parser/parse_func.c
parent8e211f5391465bddda79e17e63c79dbc8c70e6d1 (diff)
Fix crash when using CALL on an aggregate
Author: Ashutosh Bapat <[email protected]> Reported-by: Rushabh Lathia <[email protected]>
Diffstat (limited to 'src/backend/parser/parse_func.c')
-rw-r--r--src/backend/parser/parse_func.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 2f20516e766..e6b085637b2 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -336,6 +336,15 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
Form_pg_aggregate classForm;
int catDirectArgs;
+ if (proc_call)
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_FUNCTION),
+ errmsg("%s is not a procedure",
+ func_signature_string(funcname, nargs,
+ argnames,
+ actual_arg_types)),
+ parser_errposition(pstate, location)));
+
tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcid));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for aggregate %u", funcid);