mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Aggregate functions now support multiple input arguments. I also took
the opportunity to treat COUNT(*) as a zero-argument aggregate instead of the old hack that equated it to COUNT(1); this is materially cleaner (no more weird ANYOID cases) and ought to be at least a tiny bit faster. Original patch by Sergey Koposov; review, documentation, simple regression tests, pg_dump and psql support by moi.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.192 2006/07/14 14:52:19 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.193 2006/07/27 19:52:05 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -3174,10 +3174,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
|
||||
aggstate->aggs = lcons(astate, aggstate->aggs);
|
||||
naggs = ++aggstate->numaggs;
|
||||
|
||||
astate->target = ExecInitExpr(aggref->target, parent);
|
||||
astate->args = (List *) ExecInitExpr((Expr *) aggref->args,
|
||||
parent);
|
||||
|
||||
/*
|
||||
* Complain if the aggregate's argument contains any
|
||||
* Complain if the aggregate's arguments contain any
|
||||
* aggregates; nested agg functions are semantically
|
||||
* nonsensical. (This should have been caught earlier,
|
||||
* but we defend against it here anyway.)
|
||||
|
Reference in New Issue
Block a user