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.
Just simply click -> Aggregate to open an object pane for Aggregate.
A right-click displays the popup menu or using the object pane toolbar below,
allowing you to create new, edit and delete the selected aggregate.
Create Aggregate
To create a new aggregate
- Select anywhere on the object pane.
- Click the
New Aggregate from the object pane toolbar.
or - Right-click and select
New Aggregate from the popup menu.
- Edit aggregate properties on the appropriate tabs of the Aggregate Designer.
To create a new aggregate with modification as one of the existing aggregate
- Select the aggregate for modifying in the object pane.
- Right-click and select the
Design Aggregate from the popup menu or simply double-click the aggregate.
or - Click the
Design Aggregate from the object pane toolbar.
- Modify aggregate properties on the appropriate tabs of the Aggregate Designer.
- Click
Save As.
To edit the existing aggregate (manage its properties etc)
- Select the aggregate for editing in the object pane.
- Right-click and select the
Design Aggregate from the popup menu or simply double-click the aggregate.
or - Click the
Design Aggregate from the object pane toolbar.
- Edit aggregate properties on the appropriate tabs of the Aggregate Designer.
To change the name of the aggregate
- Select the aggregate for editing in the object pane.
- Right-click and select the Rename from the popup menu.
Note: Support from PostgreSQL 7.4 or later.
Delete Aggregate
To delete an aggregate
- Select the aggregate for deleting in the object pane.
- Right-click and select the
Delete Aggregate from the popup menu.
or - Click the
Delete Aggregate from the object pane toolbar.
- Confirm deleting in the dialog window.
Achieve Aggregate Information
To achieve an aggregate information (OID, Aggregate Schema, Arguments and DDL, etc)
- Select the aggregate in the object pane.
- Right-click the selected aggregate and choose Aggregate Information from the popup menu to view the Object Information.
or - Choose View -> Object Information in the main menu.