This page in other versions: 9.2 / 9.3 / 9.4 / 9.5 / current (9.6)  |  Development versions: devel  |  Unsupported versions: 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4 / 9.0 / 9.1

3.2. pg_aggregate

pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each the row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max.

Table 3-2. pg_aggregate Columns

Name Type References Description
aggname name   Name of the aggregate function
aggowner int4 pg_shadow.usesysid Owner (creator) of the aggregate function
aggtransfn regproc (function)   Transition function
aggfinalfn regproc (function)   Final function
aggbasetype oid pg_type.oid The type on which this function operates when invoked from SQL
aggtranstype oid pg_type.oid The type of the aggregate function's internal transition (state) data
aggfinaltype oid pg_type.oid The type of the result
agginitval text   The initial value of the transition state. This is a text field which will be cast to the type of aggtranstype.

New aggregate functions are registered with the CREATE AGGREGATE command. See the Programmer's Guide for more information about writing aggregate functions and the meaning of the transition functions, etc.

An aggregate function is identified through name and argument type. Hence aggname and aggname are the composite primary key.

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group