Aggregates can be polymorphic, using polymorphic implementation functions.
Tom Lane <tgl@sss.pgh.pa.us>
Aggregates can be polymorphic, using polymorphic implementation functions. It also works to create a non-polymorphic aggregate from polymorphic functions, should you want to do that. Regression test added, docs still lacking. By Joe Conway, with some kibitzing from Tom Lane.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_aggregate.c | modified | +120 −22 |
| src/backend/commands/aggregatecmds.c | modified | +4 −2 |
| src/backend/executor/nodeAgg.c | modified | +53 −24 |
| src/backend/nodes/makefuncs.c | modified | +22 −1 |
| src/backend/parser/parse_agg.c | modified | +92 −1 |
| src/backend/parser/parse_coerce.c | modified | +75 −26 |
| src/backend/utils/cache/lsyscache.c | modified | +31 −1 |
| src/include/nodes/makefuncs.h | modified | +4 −1 |
| src/include/parser/parse_agg.h | modified | +9 −1 |
| src/include/parser/parse_coerce.h | modified | +4 −1 |
| src/include/utils/lsyscache.h | modified | +2 −1 |
| src/test/regress/expected/polymorphism.out | added | +514 −0 |
| src/test/regress/parallel_schedule | modified | +1 −1 |
| src/test/regress/serial_schedule | modified | +2 −1 |
| src/test/regress/sql/polymorphism.sql | added | +367 −0 |