summaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_clause.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-06-06 15:04:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-06-06 15:04:03 +0000
commite649796f128bd8702ba5744d36f4e8cb81f0b754 (patch)
tree050eda51ad8f0298731316ccf61db2c01a2863a3 /src/backend/parser/parse_clause.c
parent2c93861f7cef99b4613abd37ed7e4c15a95754b4 (diff)
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_clause.c')
-rw-r--r--src/backend/parser/parse_clause.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index 1c8cb8bc0e3..a29eb007fb7 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.113 2003/04/29 22:13:10 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.114 2003/06/06 15:04:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,6 +30,7 @@
#include "parser/parse_relation.h"
#include "parser/parse_target.h"
#include "parser/parse_type.h"
+#include "rewrite/rewriteManip.h"
#include "utils/builtins.h"
#include "utils/guc.h"
@@ -494,7 +495,7 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r)
*/
if (pstate->p_hasAggs)
{
- if (contain_agg_clause(funcexpr))
+ if (checkExprHasAggs(funcexpr))
elog(ERROR, "cannot use aggregate function in FROM function expression");
}