Contents
CREATE AGGREGATE
A DDL command for defining a new aggregate function
CREATE AGGREGATE
is a DDL command for defining a new aggregate function.
CREATE AGGREGATE
has always been present in PostgreSQL.
Change history
- PostgreSQL 12
OR REPLACE
syntax added (commit 01bde4fa)
- PostgreSQL 11
- support for tracking whether aggregate final functions modify transition state (commit 4de2d4fb)
- PostgreSQL 9.6
- PostgreSQL 9.4
- options for moving-aggregate optimization added (commit a9d9acbf)
- options enabling polymorphic aggregates to have non-polymorphic state data types added (commit f0fedfe8)
- support for
VARIADIC
aggregate functions (commit 0d3f4406) - support for ordered-set (
WITHIN GROUP
) aggregate functions (commit 8d65da1f)
- PostgreSQL 8.2
- new syntax
CREATE AGGREGATE name (input_data_type [, ...]) (parameter_list)
added (commit 3651a3e6)
- new syntax
Note: while new syntax was introduced in PostgreSQL 8.2, the old syntax is retained for backwards compatibility.
References
- PostgreSQL documentation: CREATE AGGREGATE