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/executor/nodeSubplan.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/executor/nodeSubplan.c')
-rw-r--r-- | src/backend/executor/nodeSubplan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index 5d9bdc84241..ff5d03faf8c 100644 --- a/src/backend/executor/nodeSubplan.c +++ b/src/backend/executor/nodeSubplan.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.45 2003/04/08 23:20:01 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.46 2003/06/06 15:04:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -240,7 +240,9 @@ ExecScanSubPlan(SubPlanState *node, oldcontext = MemoryContextSwitchTo(node->sub_estate->es_query_cxt); /* - * Set Params of this plan from parent plan correlation Vars + * Set Params of this plan from parent plan correlation values. + * (Any calculation we have to do is done in the parent econtext, + * since the Param values don't need to have per-query lifetime.) */ pvar = node->args; foreach(lst, subplan->parParam) |