Hello, I’m DocuDroid!
Submitting feedback
Thank you for rating our AI Search!
We would be grateful if you could share your thoughts so we can improve our AI Search for you and other readers.
GitHub

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.

Column Type References Description

aggfnoid

regproc

pg_proc.oid

OID of the aggregate function

aggkind

char

 — 

Aggregate kind: n for normal aggregates, o for ordered-set aggregates, or h for hypothetical-set aggregates

aggnumdirectargs

int2

 — 

Number of direct (non-aggregated) arguments of an ordered-set or hypothetical-set aggregate, counting a variadic array as one argument. If equal to pronargs, the aggregate must be variadic and the variadic array describes the aggregated arguments as well as the final direct arguments. Always 0 for normal aggregates

aggtransfn

regproc

pg_proc.oid

Transition function OID

aggfinalfn

regproc

pg_proc.oid

Final function OID (0 if none)

aggcombinefn

regproc

pg_proc.oid

Combine function OID (0 if none)

aggserialfn

regproc

pg_proc.oid

OID of the serialization function to convert transtype to bytea (0 if none)

aggdeserialfn

regproc

pg_proc.oid

OID of the deserialization function to convert bytea to transtype (0 if none)

aggmtransfn

regproc

pg_proc.oid

Forward transition function OID for moving-aggregate mode (0 if none)

aggminvtransfn

regproc

pg_proc.oid

Inverse transition function OID for moving-aggregate mode (0 if none)

aggmfinalfn

regproc

pg_proc.oid

Final function OID for moving-aggregate mode (0 if none)

aggfinalextra

boolean

 — 

true to pass extra dummy arguments to aggfinalfn

aggmfinalextra

boolean

 — 

true to pass extra dummy arguments to aggmfinalfn

aggsortop

oid

pg_operator.oid

Associated sort operator OID (0 if none)

aggtranstype

oid

pg_type.oid

Data type of the aggregate function’s internal transition (state) data

aggtransspace

integer

 — 

Approximate average size (in bytes) of the transition state data, or 0 to use a default estimate

aggmtranstype

oid

pg_type.oid

Data type of the aggregate function’s internal transition (state) data for moving-aggregate mode (0 if none)

aggmtransspace

integer

 — 

Approximate average size (in bytes) of the transition state data for moving-aggregate mode, or 0 to use a default estimate

agginitval

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

aggminitval

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