diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-15 17:57:48 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-15 17:57:48 +0000 |
| commit | 34d26872ed816b299eef2fa4240d55316697f42d (patch) | |
| tree | d7373e29b365c151702c44325f0f5cc9dcc3e17c /src/backend/nodes/copyfuncs.c | |
| parent | 6a6efb964092902bf53965649c3ed78b1868b37e (diff) | |
Support ORDER BY within aggregate function calls, at long last providing a
non-kluge method for controlling the order in which values are fed to an
aggregate function. At the same time eliminate the old implementation
restriction that DISTINCT was only supported for single-argument aggregates.
Possibly release-notable behavioral change: formerly, agg(DISTINCT x)
dropped null values of x unconditionally. Now, it does so only if the
agg transition function is strict; otherwise nulls are treated as DISTINCT
normally would, ie, you get one copy.
Andrew Gierth, reviewed by Hitoshi Harada
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
| -rw-r--r-- | src/backend/nodes/copyfuncs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index c0bb01f1414..018f36cef60 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.453 2009/12/07 05:22:22 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.454 2009/12/15 17:57:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1023,9 +1023,10 @@ _copyAggref(Aggref *from) COPY_SCALAR_FIELD(aggfnoid); COPY_SCALAR_FIELD(aggtype); COPY_NODE_FIELD(args); - COPY_SCALAR_FIELD(agglevelsup); + COPY_NODE_FIELD(aggorder); + COPY_NODE_FIELD(aggdistinct); COPY_SCALAR_FIELD(aggstar); - COPY_SCALAR_FIELD(aggdistinct); + COPY_SCALAR_FIELD(agglevelsup); COPY_LOCATION_FIELD(location); return newnode; @@ -1968,6 +1969,7 @@ _copyFuncCall(FuncCall *from) COPY_NODE_FIELD(funcname); COPY_NODE_FIELD(args); + COPY_NODE_FIELD(agg_order); COPY_SCALAR_FIELD(agg_star); COPY_SCALAR_FIELD(agg_distinct); COPY_SCALAR_FIELD(func_variadic); |
