Provided by: manpages-zh_1.5.2-1_all bug

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  <laser@pgsqldb.org>