pg_aggregate
pg_aggregate#
The pg_aggregate table stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate
is an extension of an entry in pg_proc
. The pg_proc
entry carries the aggregate’s name, input and output data types, and other information that is similar to ordinary functions.
Table 1. pg_catalog.pg_aggregate
column |
type |
references |
description |
---|---|---|---|
|
regproc |
pg_proc.oid |
OID of the aggregate function |
|
char |
Aggregate kind: n for normal aggregates, o for ordered-set aggregates, or h for hypothetical-set aggregates |
|
|
smallint |
Number of direct (non-aggregated) arguments of an ordered-set or hypothetical-set aggregate, counting a variadic array as one argument. If equal to |
|
|
regproc |
pg_proc.oid |
Transition function OID |
|
regproc |
pg_proc.oid |
Final function OID (zero if none) |
|
regproc |
pg_proc.oid |
Combine function OID (zero if none) |
|
regproc |
pg_proc.oid |
OID of the serialization function to convert transtype to |
|
regproc |
pg_proc.oid |
OID of the deserialization function to convert |
|
regproc |
pg_proc.oid |
Forward transition function OID for moving-aggregate mode (zero if none) |
|
regproc |
pg_proc.oid |
Inverse transition function OID for moving-aggregate mode (zero if none) |
|
regproc |
pg_proc.oid |
Final function OID for moving-aggregate mode (zero if none) |
|
bool |
True to pass extra dummy arguments to |
|
|
bool |
True to pass extra dummy arguments to |
|
|
char |
Indicates whether |
|
|
char |
Indicates whether |
|
|
oid |
pg_operator.oid |
Associated sort operator OID (zero if none) |
|
oid |
pg_type.oid |
Data type of the aggregate function’s internal transition (state) data |
|
integer |
Approximate average size (in bytes) of the transition state data, or zero to use a default estimate |
|
|
oid |
pg_type.oid |
Data type of the aggregate function’s internal transition (state) data for moving-aggregate mode (zero if none) |
|
integer |
Approximate average size (in bytes) of the transition state data for moving-aggregate mode, or zero to use a default estimate |
|
|
text |
The initial value of the transition state. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL. |
|
|
text |
The initial value of the transition state for moving- aggregate mode. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL. |
|
|
bool |
True to specify that the aggregate can be safely executed on replicated slices. An order-agnostic aggregate would be considered safe in this context. |