Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads
51.2. pg_aggregate
Prev UpChapter 51. System CatalogsHome Next

51.2. pg_aggregate#

The catalogpg_aggregate 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 aresum,count, andmax. Each entry inpg_aggregate is an extension of an entry inpg_proc. Thepg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions.

Table 51.2. pg_aggregate Columns

Column Type

Description

aggfnoidregproc (referencespg_proc.oid)

pg_proc OID of the aggregate function

aggkindchar

Aggregate kind:n fornormal aggregates,o forordered-set aggregates, orh forhypothetical-set aggregates

aggnumdirectargsint2

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

aggtransfnregproc (referencespg_proc.oid)

Transition function

aggfinalfnregproc (referencespg_proc.oid)

Final function (zero if none)

aggcombinefnregproc (referencespg_proc.oid)

Combine function (zero if none)

aggserialfnregproc (referencespg_proc.oid)

Serialization function (zero if none)

aggdeserialfnregproc (referencespg_proc.oid)

Deserialization function (zero if none)

aggmtransfnregproc (referencespg_proc.oid)

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

aggminvtransfnregproc (referencespg_proc.oid)

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

aggmfinalfnregproc (referencespg_proc.oid)

Final function for moving-aggregate mode (zero if none)

aggfinalextrabool

True to pass extra dummy arguments toaggfinalfn

aggmfinalextrabool

True to pass extra dummy arguments toaggmfinalfn

aggfinalmodifychar

Whetheraggfinalfn modifies the transition state value:r if it is read-only,s if theaggtransfn cannot be applied after theaggfinalfn, orw if it writes on the value

aggmfinalmodifychar

Likeaggfinalmodify, but for theaggmfinalfn

aggsortopoid (referencespg_operator.oid)

Associated sort operator (zero if none)

aggtranstypeoid (referencespg_type.oid)

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

aggtransspaceint4

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

aggmtranstypeoid (referencespg_type.oid)

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

aggmtransspaceint4

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

agginitvaltext

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.

aggminitvaltext

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.


New aggregate functions are registered with theCREATE AGGREGATE command. SeeSection 36.12 for more information about writing aggregate functions and the meaning of the transition functions, etc.


Prev Up Next
51.1. Overview Home 51.3. pg_am
pdfepub
Go to Postgres Pro Standard 17
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp