agg cannot contain set-returning function calls

This commit is contained in:
chenxiaobin19
2022-12-26 17:50:46 +08:00
parent 7ff965f389
commit 785a596df1
6 changed files with 93 additions and 22 deletions

View File

@ -211,6 +211,14 @@ void transformAggregateCall(ParseState* pstate, Aggref* agg, List* args, List* a
}
}
/* It can't contain set-returning functions either */
if (checkExprHasSetReturningFuncs((Node*)agg->args)) {
ereport(ERROR,
(errcode(ERRCODE_GROUPING_ERROR),
errmsg("aggregate function calls cannot contain set-returning function calls"),
parser_errposition(pstate, locate_srfunc((Node*)agg->args))));
}
/* It can't contain window functions either */
if (pstate->p_hasWindowFuncs && checkExprHasWindowFuncs((Node*)agg->args)) {
ereport(ERROR,