mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Aggregate functions now support multiple input arguments. I also took
the opportunity to treat COUNT(*) as a zero-argument aggregate instead of the old hack that equated it to COUNT(1); this is materially cleaner (no more weird ANYOID cases) and ought to be at least a tiny bit faster. Original patch by Sergey Koposov; review, documentation, simple regression tests, pg_dump and psql support by moi.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.343 2006/07/14 14:52:19 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.344 2006/07/27 19:52:05 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -743,7 +743,7 @@ _copyAggref(Aggref *from)
|
||||
|
||||
COPY_SCALAR_FIELD(aggfnoid);
|
||||
COPY_SCALAR_FIELD(aggtype);
|
||||
COPY_NODE_FIELD(target);
|
||||
COPY_NODE_FIELD(args);
|
||||
COPY_SCALAR_FIELD(agglevelsup);
|
||||
COPY_SCALAR_FIELD(aggstar);
|
||||
COPY_SCALAR_FIELD(aggdistinct);
|
||||
|
@@ -18,7 +18,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.277 2006/07/14 14:52:20 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.278 2006/07/27 19:52:05 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -156,7 +156,7 @@ _equalAggref(Aggref *a, Aggref *b)
|
||||
{
|
||||
COMPARE_SCALAR_FIELD(aggfnoid);
|
||||
COMPARE_SCALAR_FIELD(aggtype);
|
||||
COMPARE_NODE_FIELD(target);
|
||||
COMPARE_NODE_FIELD(args);
|
||||
COMPARE_SCALAR_FIELD(agglevelsup);
|
||||
COMPARE_SCALAR_FIELD(aggstar);
|
||||
COMPARE_SCALAR_FIELD(aggdistinct);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.278 2006/07/14 14:52:20 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/outfuncs.c,v 1.279 2006/07/27 19:52:05 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Every node type that can appear in stored rules' parsetrees *must*
|
||||
@@ -635,7 +635,7 @@ _outAggref(StringInfo str, Aggref *node)
|
||||
|
||||
WRITE_OID_FIELD(aggfnoid);
|
||||
WRITE_OID_FIELD(aggtype);
|
||||
WRITE_NODE_FIELD(target);
|
||||
WRITE_NODE_FIELD(args);
|
||||
WRITE_UINT_FIELD(agglevelsup);
|
||||
WRITE_BOOL_FIELD(aggstar);
|
||||
WRITE_BOOL_FIELD(aggdistinct);
|
||||
|
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.191 2006/07/03 22:45:39 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.192 2006/07/27 19:52:05 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Path and Plan nodes do not have any readfuncs support, because we
|
||||
@@ -348,7 +348,7 @@ _readAggref(void)
|
||||
|
||||
READ_OID_FIELD(aggfnoid);
|
||||
READ_OID_FIELD(aggtype);
|
||||
READ_NODE_FIELD(target);
|
||||
READ_NODE_FIELD(args);
|
||||
READ_UINT_FIELD(agglevelsup);
|
||||
READ_BOOL_FIELD(aggstar);
|
||||
READ_BOOL_FIELD(aggdistinct);
|
||||
|
Reference in New Issue
Block a user