CREATE AGGREGATE(7) SQL Commands CREATE AGGREGATE(7) NAME CREATE AGGREGATE - SYNOPSIS CREATE AGGREGATE name ( BASETYPE = input_data_type, SFUNC = sfunc, STYPE = state_data_type [ , FINALFUNC = ffunc ] [ , INITCOND = initial_condition ] ) DESCRIPTION CREATE AGGREGATE min(integer) avg(double precision) CREATE AGGREGATE CREATE AGGREGATE myschema.myagg ... sfunc, ffunc. sfunc( internal-state, next-data-item ) ---> next-internal-state ffunc( internal-state ) ---> aggregate-value PostgreSQL stype text NULL "strict" NULL NULL NULL NULL NULL max state_type input_data_type NULL strice strict NULL NULL "strict" NULL NULL strict NULL avg NULL PARAMETERS name input_data_type "ANY" count(*) sfunc state_data_type input_data_type. state_data_type state_data_type state_data_type ffunc / state_data_type ffunc state_data_type initial_condition state_data_type NULL CREATE AGGREGATE EXAMPLES ``User-defined Aggregates'' COMPATIBILITY CREATE AGGREGATE PostgreSQL SQL CREATE AGGREGATE SEE ALSO ALTER AGGREGATE [alter_aggregate(7)], DROP AGGREGATE [drop_aggregate(l)] Postgresql man man https://github.com/man-pages-zh/manpages- zh SQL - Language Statements 2003-11-02 CREATE AGGREGATE(7)