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/include/nodes/primnodes.h | |
| parent | 2c93861f7cef99b4613abd37ed7e4c15a95754b4 (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/include/nodes/primnodes.h')
| -rw-r--r-- | src/include/nodes/primnodes.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 558621c9006..12af0fd0925 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: primnodes.h,v 1.82 2003/05/06 00:20:33 tgl Exp $ + * $Id: primnodes.h,v 1.83 2003/06/06 15:04:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -223,6 +223,7 @@ typedef struct Aggref Oid aggfnoid; /* pg_proc Oid of the aggregate */ Oid aggtype; /* type Oid of result of the aggregate */ Expr *target; /* expression we are aggregating on */ + Index agglevelsup; /* > 0 if agg belongs to outer query */ bool aggstar; /* TRUE if argument was really '*' */ bool aggdistinct; /* TRUE if it's agg(DISTINCT ...) */ } Aggref; |
