diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-06 15:04:03 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-06-06 15:04:03 +0000 |
commit | e649796f128bd8702ba5744d36f4e8cb81f0b754 (patch) | |
tree | 050eda51ad8f0298731316ccf61db2c01a2863a3 /src/backend/parser/parse_func.c | |
parent | 2c93861f7cef99b4613abd37ed7e4c15a95754b4 (diff) | |
download | postgresql-e649796f128bd8702ba5744d36f4e8cb81f0b754.tar.gz postgresql-e649796f128bd8702ba5744d36f4e8cb81f0b754.zip |
Implement outer-level aggregates to conform to the SQL spec, with
extensions to support our historical behavior. An aggregate belongs
to the closest query level of any of the variables in its argument,
or the current query level if there are no variables (e.g., COUNT(*)).
The implementation involves adding an agglevelsup field to Aggref,
and treating outer aggregates like outer variables at planning time.
Diffstat (limited to 'src/backend/parser/parse_func.c')
-rw-r--r-- | src/backend/parser/parse_func.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index e9a40e03179..6f858e17a8b 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.148 2003/05/26 00:11:27 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.149 2003/06/06 15:04:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -20,6 +20,7 @@ #include "catalog/pg_proc.h" #include "lib/stringinfo.h" #include "nodes/makefuncs.h" +#include "parser/parse_agg.h" #include "parser/parse_coerce.h" #include "parser/parse_expr.h" #include "parser/parse_func.h" @@ -336,12 +337,13 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, aggref->aggstar = agg_star; aggref->aggdistinct = agg_distinct; + /* parse_agg.c does additional aggregate-specific processing */ + transformAggregateCall(pstate, aggref); + retval = (Node *) aggref; if (retset) elog(ERROR, "Aggregates may not return sets"); - - pstate->p_hasAggs = true; } return retval; |