Online Documentation for SQL Manager for PostgreSQL

Aggregates


Aggregate functions, or Aggregates, perform a calculation on a set of values and return a single value, i.e. compute a single result value from a set of input values.

 

Aggregate functions in PostgreSQL are expressed as state values and state transition functions. That is, an aggregate can be defined in terms of state that is modified whenever an input item is processed. To define a new aggregate function, one selects a data type for the state value, an initial value for the state, and a state transition function. The state transition function is just an ordinary function that could also be used outside the context of the aggregate. A final function can also be specified, in case the desired result of the aggregate is different from the data that needs to be kept in the running state value.

 

Aggregate Editor allows you to define aggregate properties. It opens automatically when you create a new aggregate and is available on editing an existing one.