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.
Create a Aggregate
To create a aggregate:
- Select the Database in the Tree View and select Others
>
Aggregate from the toolbar
- Press the
New Aggregate button
- Enter Aggregate properties and fields on the appropriate
tabs of the New Aggregate Editor
- Click OK
Design a Aggregate
To design a aggregate:
- Select the Database in the Tree View and select Others
>
Aggregate from the toolbar
- Select the aggregate you want to design.
- Press the
Design Aggregate button.
- Edit Aggregate properties and fields on the appropriate
tabs of the Design Aggregate Editor
- Click OK
Delete a Aggregate
To delete a aggregate:
- Select the Database in the Tree View and select Others
>
Aggregate from the toolbar
- Select the aggregate you want to delete.
- Click the
Delete Aggregate button.
- Confirm deleting in the dialog window.
|