{"Entry":{"collection":"catalog","key":"pg_aggregate","name":"pg_aggregate","aliases":[],"metadata":{"changed_in":["8.1","9.4","9.6","11"],"changes":[{"added":["aggsortop"],"attributes":[],"description_changed":false,"descriptions":[{"from":"The initial value of the transition state. This is a text field containing the initial value in its external string representation. If the value is null, the transition state value starts out null.","name":"agginitval","to":"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."},{"from":"The type of the aggregate function's internal transition (state) data","name":"aggtranstype","to":"Data type of the aggregate function's internal transition (state) data"}],"from":"8.0","listing":[],"order":false,"removed":[],"status":"changed","to":"8.1","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"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.","name":"agginitval","to":"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"}],"from":"8.1","listing":[],"order":false,"removed":[],"status":"reworded","to":"8.2","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"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","name":"agginitval","to":"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."}],"from":"8.4","listing":[],"order":false,"removed":[],"status":"reworded","to":"9.0","types":[],"unlisted":[]},{"added":["aggkind","aggnumdirectargs","aggmtransfn","aggminvtransfn","aggmfinalfn","aggfinalextra","aggmfinalextra","aggtransspace","aggmtranstype","aggmtransspace","aggminitval"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.3","listing":[],"order":false,"removed":[],"status":"changed","to":"9.4","types":[],"unlisted":[]},{"added":["aggcombinefn","aggserialfn","aggdeserialfn"],"attributes":[],"description_changed":false,"descriptions":[],"from":"9.5","listing":[],"order":false,"removed":[],"status":"changed","to":"9.6","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Aggregate kind: n for \"normal\" aggregates, o for \"ordered-set\" aggregates, or h for \"hypothetical-set\" aggregates","name":"aggkind","to":"Aggregate kind: n for “normal” aggregates, o for “ordered-set” aggregates, or h for “hypothetical-set” aggregates"}],"from":"9.6","listing":[],"order":false,"removed":[],"status":"reworded","to":"10","types":[],"unlisted":[]},{"added":["aggfinalmodify","aggmfinalmodify"],"attributes":[],"description_changed":false,"descriptions":[],"from":"10","listing":[],"order":false,"removed":[],"status":"changed","to":"11","types":[],"unlisted":[]},{"added":[],"attributes":[],"description_changed":false,"descriptions":[{"from":"Approximate average size (in bytes) of the transition state data, or zero to use a default estimate","name":"aggtransspace","to":"Approximate average size (in bytes) of the transition state data. A positive value provides an estimate; zero means to use a default estimate. A negative value indicates the state data can grow unboundedly in size, such as when the aggregate accumulates input rows (e.g., array_agg, string_agg)."}],"from":"18","listing":[],"order":false,"removed":[],"status":"reworded","to":"19","types":[],"unlisted":[]}],"column_count":22,"content_hash":"b7b0fae03fe854e2bdd6bd5433991b608eb384668db15f25a5661ca81ddadd04","first_version":"7.4","imported_at":"2026-09-30T00:40:55.273283+08:00","kind":"catalog","last_version":"20","name":"pg_aggregate","position":0,"present_in":["7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"relation_oid":null,"relkind":"r","shared":false,"source_rev":"english-manuals:f515adc138e13420ec6c9c01205de0533f32c5c137819847ace11391173f6cef","summary":"The catalog pg_aggregate stores information about aggregate functions.","summary_zh":""}},"Definition":{"Collection":"catalog","Key":"pg_aggregate","SourceDatabase":"center","Version":"18","SourceTable":"catalog","SourceKey":"pg_aggregate","SourceRevision":"english-manuals:f515adc138e13420ec6c9c01205de0533f32c5c137819847ace11391173f6cef","Facts":{"columns":[{"array_dimensions":0,"attnum":1,"description":"pg_proc OID of the aggregate function","description_zh":"","documented":true,"documented_name":"aggfnoid","hidden":false,"name":"aggfnoid","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":2,"description":"Aggregate kind: n for “normal” aggregates, o for “ordered-set” aggregates, or h for “hypothetical-set” aggregates","description_zh":"","documented":true,"documented_name":"aggkind","hidden":false,"name":"aggkind","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":3,"description":"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 zero for normal aggregates.","description_zh":"","documented":true,"documented_name":"aggnumdirectargs","hidden":false,"name":"aggnumdirectargs","not_null":true,"references":"","type":"int2","type_modifier":-1,"type_oid":21},{"array_dimensions":0,"attnum":4,"description":"Transition function","description_zh":"","documented":true,"documented_name":"aggtransfn","hidden":false,"name":"aggtransfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":5,"description":"Final function (zero if none)","description_zh":"","documented":true,"documented_name":"aggfinalfn","hidden":false,"name":"aggfinalfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":6,"description":"Combine function (zero if none)","description_zh":"","documented":true,"documented_name":"aggcombinefn","hidden":false,"name":"aggcombinefn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":7,"description":"Serialization function (zero if none)","description_zh":"","documented":true,"documented_name":"aggserialfn","hidden":false,"name":"aggserialfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":8,"description":"Deserialization function (zero if none)","description_zh":"","documented":true,"documented_name":"aggdeserialfn","hidden":false,"name":"aggdeserialfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":9,"description":"Forward transition function for moving-aggregate mode (zero if none)","description_zh":"","documented":true,"documented_name":"aggmtransfn","hidden":false,"name":"aggmtransfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":10,"description":"Inverse transition function for moving-aggregate mode (zero if none)","description_zh":"","documented":true,"documented_name":"aggminvtransfn","hidden":false,"name":"aggminvtransfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":11,"description":"Final function for moving-aggregate mode (zero if none)","description_zh":"","documented":true,"documented_name":"aggmfinalfn","hidden":false,"name":"aggmfinalfn","not_null":true,"references":"pg_proc.oid","type":"regproc","type_modifier":-1,"type_oid":24},{"array_dimensions":0,"attnum":12,"description":"True to pass extra dummy arguments to aggfinalfn","description_zh":"","documented":true,"documented_name":"aggfinalextra","hidden":false,"name":"aggfinalextra","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":13,"description":"True to pass extra dummy arguments to aggmfinalfn","description_zh":"","documented":true,"documented_name":"aggmfinalextra","hidden":false,"name":"aggmfinalextra","not_null":true,"references":"","type":"bool","type_modifier":-1,"type_oid":16},{"array_dimensions":0,"attnum":14,"description":"Whether aggfinalfn modifies the transition state value: r if it is read-only, s if the aggtransfn cannot be applied after the aggfinalfn, or w if it writes on the value","description_zh":"","documented":true,"documented_name":"aggfinalmodify","hidden":false,"name":"aggfinalmodify","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":15,"description":"Like aggfinalmodify, but for the aggmfinalfn","description_zh":"","documented":true,"documented_name":"aggmfinalmodify","hidden":false,"name":"aggmfinalmodify","not_null":true,"references":"","type":"char","type_modifier":-1,"type_oid":18},{"array_dimensions":0,"attnum":16,"description":"Associated sort operator (zero if none)","description_zh":"","documented":true,"documented_name":"aggsortop","hidden":false,"name":"aggsortop","not_null":true,"references":"pg_operator.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":17,"description":"Data type of the aggregate function's internal transition (state) data","description_zh":"","documented":true,"documented_name":"aggtranstype","hidden":false,"name":"aggtranstype","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":18,"description":"Approximate average size (in bytes) of the transition state data, or zero to use a default estimate","description_zh":"","documented":true,"documented_name":"aggtransspace","hidden":false,"name":"aggtransspace","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":19,"description":"Data type of the aggregate function's internal transition (state) data for moving-aggregate mode (zero if none)","description_zh":"","documented":true,"documented_name":"aggmtranstype","hidden":false,"name":"aggmtranstype","not_null":true,"references":"pg_type.oid","type":"oid","type_modifier":-1,"type_oid":26},{"array_dimensions":0,"attnum":20,"description":"Approximate average size (in bytes) of the transition state data for moving-aggregate mode, or zero to use a default estimate","description_zh":"","documented":true,"documented_name":"aggmtransspace","hidden":false,"name":"aggmtransspace","not_null":true,"references":"","type":"int4","type_modifier":-1,"type_oid":23},{"array_dimensions":0,"attnum":21,"description":"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.","description_zh":"","documented":true,"documented_name":"agginitval","hidden":false,"name":"agginitval","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25},{"array_dimensions":0,"attnum":22,"description":"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.","description_zh":"","documented":true,"documented_name":"aggminitval","hidden":false,"name":"aggminitval","not_null":false,"references":"","type":"text","type_modifier":-1,"type_oid":25}],"description":"The catalog 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 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.","description_zh":"","doc":{"anchor":"id-1.10.4.4.4","file":"catalog-pg-aggregate.html","lang":"en","sha256":"5eeb296d892c3216c7f00b05f8542c9414b9fdb95f1a425016b52b79de26507e","slug":"18"},"kind":"catalog","lang":"en","measured_attributes":true,"metadata_release":"18.6","runtime_columns":["aggfnoid","aggkind","aggnumdirectargs","aggtransfn","aggfinalfn","aggcombinefn","aggserialfn","aggdeserialfn","aggmtransfn","aggminvtransfn","aggmfinalfn","aggfinalextra","aggmfinalextra","aggfinalmodify","aggmfinalmodify","aggsortop","aggtranstype","aggtransspace","aggmtranstype","aggmtransspace","agginitval","aggminitval"],"runtime_verified":false,"source":"english-manual"},"ManualEvidence":{"doc":{"anchor":"id-1.10.4.4.4","file":"catalog-pg-aggregate.html","lang":"en","sha256":"5eeb296d892c3216c7f00b05f8542c9414b9fdb95f1a425016b52b79de26507e","slug":"18"}},"MeasuredEvidence":{"measured_attributes":true,"metadata_release":"18.6","runtime_columns":["aggfnoid","aggkind","aggnumdirectargs","aggtransfn","aggfinalfn","aggcombinefn","aggserialfn","aggdeserialfn","aggmtransfn","aggminvtransfn","aggmfinalfn","aggfinalextra","aggmfinalextra","aggfinalmodify","aggmfinalmodify","aggsortop","aggtranstype","aggtransspace","aggmtranstype","aggmtransspace","agginitval","aggminitval"],"runtime_verified":false}},"Text":{"Collection":"catalog","Key":"pg_aggregate","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"pg_aggregate","Summary":"目录pg_aggregate存储关于聚合函数的信息。聚合函数是对一组值（典型的是每个匹配查询条件的行中的同一个列的值）进行操作的函数，它返回从这些值中计算出的单个值。典型的聚合函数是 sum、count和max。pg_aggregate里的每个项都是一个pg_proc项的扩展。pg_proc项记载该聚合的名字、输入和输出数据类型，以及其他一些和普通函数类似的信息。","BodyHTML":"\u003cp\u003e目录pg_aggregate存储关于聚合函数的信息。聚合函数是对一组值（典型的是每个匹配查询条件的行中的同一个列的值）进行操作的函数，它返回从这些值中计算出的单个值。典型的聚合函数是 sum、count和max。pg_aggregate里的每个项都是一个pg_proc项的扩展。pg_proc项记载该聚合的名字、输入和输出数据类型，以及其他一些和普通函数类似的信息。\u003c/p\u003e","SourceRevision":"2026-09-27@419045e","ContentHash":"bc5063531346ebd0c2d8583bf0ef52886cc92a4198895a22202c27e410d7f82b","Payload":{"columns":[{"description_zh":"聚合函数对应的 pg_proc OID","name":"aggfnoid","type":"regproc","zh_from":"doc"},{"description_zh":"聚合种类：n 表示“普通”聚合，o 表示“有序集”聚合，或 h 表示“假想集”聚合","name":"aggkind","type":"\"char\"","zh_from":"doc"},{"description_zh":"有序集或假想集聚合的直接（非聚合）参数个数，其中一个可变参数数组算作一个参数。如果它等于pronargs，则该聚合必定是可变参数的，并且该可变参数数组既描述聚合参数也描述末尾的直接参数。对普通聚合总为零。","name":"aggnumdirectargs","type":"smallint","zh_from":"doc"},{"description_zh":"转移函数","name":"aggtransfn","type":"regproc","zh_from":"doc"},{"description_zh":"最终函数（如果没有就为零）","name":"aggfinalfn","type":"regproc","zh_from":"doc"},{"description_zh":"合并函数（如果没有就为零）","name":"aggcombinefn","type":"regproc","zh_from":"doc"},{"description_zh":"序列化函数（如果没有就为零）","name":"aggserialfn","type":"regproc","zh_from":"doc"},{"description_zh":"反序列化函数（如果没有就为零）","name":"aggdeserialfn","type":"regproc","zh_from":"doc"},{"description_zh":"用于移动聚合模式的前向状态转移函数（如果没有就为零）","name":"aggmtransfn","type":"regproc","zh_from":"doc"},{"description_zh":"用于移动聚合模式的逆向状态转移函数（如果没有就为零）","name":"aggminvtransfn","type":"regproc","zh_from":"doc"},{"description_zh":"用于移动聚合模式的最终函数（如果没有就为零）","name":"aggmfinalfn","type":"regproc","zh_from":"doc"},{"description_zh":"若为真，则会向aggfinalfn传递额外的虚拟参数","name":"aggfinalextra","type":"boolean","zh_from":"doc"},{"description_zh":"若为真，则会向aggmfinalfn传递额外的虚拟参数","name":"aggmfinalextra","type":"boolean","zh_from":"doc"},{"description_zh":"aggfinalfn 是否修改转移状态值：r 表示只读，s 表示在aggfinalfn之后不能再应用aggtransfn，或 w 表示它会写入该值","name":"aggfinalmodify","type":"\"char\"","zh_from":"doc"},{"description_zh":"类似于aggfinalmodify，但用于aggmfinalfn","name":"aggmfinalmodify","type":"\"char\"","zh_from":"doc"},{"description_zh":"相关联的排序操作符（如果没有则为0）","name":"aggsortop","type":"oid","zh_from":"doc"},{"description_zh":"聚合函数的内部转移（状态）数据的数据类型","name":"aggtranstype","type":"oid","zh_from":"doc"},{"description_zh":"转移状态数据的近似平均尺寸（字节），或者为零表示使用一个默认估算值","name":"aggtransspace","type":"integer","zh_from":"doc"},{"description_zh":"聚合函数在移动聚合模式下内部转移（状态）数据的数据类型（如果没有则为零）","name":"aggmtranstype","type":"oid","zh_from":"doc"},{"description_zh":"移动聚合模式的转移状态数据的近似平均尺寸（字节），或者为零表示使用默认估算值","name":"aggmtransspace","type":"integer","zh_from":"doc"},{"description_zh":"转移状态的初始值。这是一个文本字段，包含初始值的外部字符串表示。如果此字段为 NULL，则转移状态值初始为 NULL。","name":"agginitval","type":"text","zh_from":"doc"},{"description_zh":"移动聚合模式下转移状态的初始值。这是一个文本字段，包含初始值的外部字符串表示。如果此字段为 NULL，则转移状态值初始为 NULL。","name":"aggminitval","type":"text","zh_from":"doc"}],"description_zh":"目录pg_aggregate存储关于聚合函数的信息。聚合函数是对一组值（典型的是每个匹配查询条件的行中的同一个列的值）进行操作的函数，它返回从这些值中计算出的单个值。典型的聚合函数是 sum、count和max。pg_aggregate里的每个项都是一个pg_proc项的扩展。pg_proc项记载该聚合的名字、输入和输出数据类型，以及其他一些和普通函数类似的信息。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","7.4","8.0","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
