mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
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
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.98 2009/06/11 14:49:11 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/optimizer/clauses.h,v 1.99 2009/12/15 17:57:47 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -23,7 +23,7 @@
|
||||
typedef struct
|
||||
{
|
||||
int numAggs; /* total number of aggregate calls */
|
||||
int numDistinctAggs; /* number that use DISTINCT */
|
||||
int numOrderedAggs; /* number that use DISTINCT or ORDER BY */
|
||||
Size transitionSpace; /* for pass-by-ref transition data */
|
||||
} AggClauseCounts;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user