PostgreSQL Documentation 17 User Defined
Aggregate functions in PostgreSQL are defined in terms of state values and state transition is an aggregate operates using a state value that is updated as each successive input row 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
Aggregation of events and entities over time IBM
The only difference is that shared aggregate values are read only as they are automatically updated when an event is processed You can use a shared aggregate to make a business decision The aggregate is generated and shared with any agent that is bound to the entity The entity attribute must be defined in the business model definitions