-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-aggregate.html
More file actions
304 lines (304 loc) · 20.8 KB
/
catalog-pg-aggregate.html
File metadata and controls
304 lines (304 loc) · 20.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>52.2. pg_aggregate</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="catalogs-overview.html" title="52.1. 概要" /><link rel="next" href="catalog-pg-am.html" title="52.3. pg_am" /><meta name="viewport" content="width=device-width,initial-scale=1.0" /></head><body id="docContent" class="container-fluid col-10"><div class="other_version"><a href="https://www.postgresql.jp/document/">バージョンごとのドキュメント一覧</a></div><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 18.3文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="catalogs.html" title="第52章 システムカタログ">第52章 システムカタログ</a></td><td width="20%" align="right"><div class="actions"><a class="issue" title="github" href="https://github.com/pgsql-jp/jpug-doc/issues/new?template=bug_report.yml&what-happened=version 18.3 : catalog-pg-aggregate.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalogs-overview.html" title="52.1. 概要">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="60%" align="center">52.2. <code class="structname">pg_aggregate</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-am.html" title="52.3. pg_am">次へ</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-AGGREGATE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.2. <code class="structname">pg_aggregate</code> <a href="#CATALOG-PG-AGGREGATE" class="id_link">#</a></h2></div></div></div><a id="id-1.10.4.4.2" class="indexterm"></a><p>
<span class="original">
The catalog <structname>pg_aggregate</structname> 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
<function>sum</function>, <function>count</function>, and
<function>max</function>. Each entry in
<structname>pg_aggregate</structname> is an extension of an entry
in <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.
The <structname>pg_proc</structname> entry carries the aggregate's name,
input and output data types, and other information that is similar to
ordinary functions.
</span>
<code class="structname">pg_aggregate</code>カタログには集約関数の情報が格納されています。
集約関数とは、値の集合(多くの場合は問い合わせ条件に該当する各行の1つの列)にある操作を行い、それらすべての値の演算の結果得られる単一の値を返します。
集約関数の代表的なものは<code class="function">sum</code>、<code class="function">count</code>そして<code class="function">max</code>です。
<code class="structname">pg_aggregate</code>内の各項目は、<code class="structname">pg_proc</code>内の項目の拡張です。
<a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>の項目には、集約の名前、入出力データ型および通常の関数と類似したその他の情報が含まれます。
</p><div class="table" id="id-1.10.4.4.4"><p class="title"><strong>表52.2 <code class="structname">pg_aggregate</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_aggregate</structname> Columns</title>
</span><table class="table" summary="pg_aggregateの列" border="1"><colgroup><col /></colgroup><thead><tr><th class="catalog_table_entry"><p class="column_definition">
<span class="original">
Column Type
</span>
列 型
</p>
<p>
<span class="original">
Description
</span>
説明
</p></th></tr></thead><tbody><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggfnoid</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
<structname>pg_proc</structname> OID of the aggregate function
</span>
<code class="structname">pg_proc</code>集約関数のOID
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggkind</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Aggregate kind:
<literal>n</literal> for <quote>normal</quote> aggregates,
<literal>o</literal> for <quote>ordered-set</quote> aggregates, or
<literal>h</literal> for <quote>hypothetical-set</quote> aggregates
</span>
集約関数の種類:
<code class="literal">n</code> = <span class="quote">「<span class="quote">通常の</span>」</span>集約関数、
<code class="literal">o</code> = <span class="quote">「<span class="quote">順序集合の</span>」</span>集約関数、
<code class="literal">h</code> = <span class="quote">「<span class="quote">仮想集合の</span>」</span>集約関数
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggnumdirectargs</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
Number of direct (non-aggregated) arguments of an ordered-set or
hypothetical-set aggregate, counting a variadic array as one argument.
If equal to <structfield>pronargs</structfield>, 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.
</span>
順序集合や仮想集合の集約関数では、(集約されていない)複数の引数は、可変長配列として1個の引数と見なします。
引数の数が<code class="structfield">pronargs</code>と同じ場合、最終的な直接引数同様、集約された引数として、集約関数の引数は、可変または可変長配列で記述しなければなりません。
通常の集約関数は引数を取りません。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggtransfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Transition function
</span>
遷移関数
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggfinalfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Final function (zero if none)
</span>
最終関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggcombinefn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Combine function (zero if none)
</span>
結合関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggserialfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Serialization function (zero if none)
</span>
直列化関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggdeserialfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Deserialization function (zero if none)
</span>
逆直列化関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmtransfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Forward transition function for moving-aggregate mode (zero if none)
</span>
移動集約モードの順方向遷移関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggminvtransfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Inverse transition function for moving-aggregate mode (zero if none)
</span>
移動集約モードの逆遷移関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmfinalfn</code> <code class="type">regproc</code>
<span class="original">
(references <link linkend="catalog-pg-proc"><structname>pg_proc</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Final function for moving-aggregate mode (zero if none)
</span>
移動集約モードの最終関数(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggfinalextra</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
True to pass extra dummy arguments to <structfield>aggfinalfn</structfield>
</span>
<code class="structfield">aggfinalfn</code>に追加の仮引数を渡す場合はtrue
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmfinalextra</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
True to pass extra dummy arguments to <structfield>aggmfinalfn</structfield>
</span>
<code class="structfield">aggmfinalfn</code>に追加の仮引数を渡す場合はtrue
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggfinalmodify</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Whether <structfield>aggfinalfn</structfield> modifies the
transition state value:
<literal>r</literal> if it is read-only,
<literal>s</literal> if the <structfield>aggtransfn</structfield>
cannot be applied after the <structfield>aggfinalfn</structfield>, or
<literal>w</literal> if it writes on the value
</span>
<code class="structfield">aggfinalfn</code>が遷移状態値を変更するかどうか:
<code class="literal">r</code> = 読み出し専用の場合、
<code class="literal">s</code> = <code class="structfield">aggfinalfn</code>の後で<code class="structfield">aggtransfn</code>を適用できない場合、
<code class="literal">w</code> = その値に書き込む場合
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmfinalmodify</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Like <structfield>aggfinalmodify</structfield>, but for
the <structfield>aggmfinalfn</structfield>
</span>
<code class="structfield">aggmfinalfn</code>用であることを除き、<code class="structfield">aggfinalmodify</code>と同様
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggsortop</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-operator.html" title="52.34. pg_operator"><code class="structname">pg_operator</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Associated sort operator (zero if none)
</span>
関連するソート演算子(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggtranstype</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-type.html" title="52.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Data type of the aggregate function's internal transition (state) data
</span>
集約関数の内部遷移(状態)データのデータ型
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggtransspace</code> <code class="type">int4</code>
</p>
<p>
<span class="original">
Approximate average size (in bytes) of the transition state
data, or zero to use a default estimate
</span>
遷移状態データの推定平均サイズ(バイト)、またはデフォルトの推定値であるゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmtranstype</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-type"><structname>pg_type</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-type.html" title="52.64. pg_type"><code class="structname">pg_type</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
Data type of the aggregate function's internal transition (state)
data for moving-aggregate mode (zero if none)
</span>
移動集約モードの、集約関数の内部遷移(状態)データのデータ型(ない時はゼロ)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggmtransspace</code> <code class="type">int4</code>
</p>
<p>
<span class="original">
Approximate average size (in bytes) of the transition state data
for moving-aggregate mode, or zero to use a default estimate
</span>
移動集約モードの、遷移状態データの推定平均サイズ(バイト)、またはデフォルトの推定値であるゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">agginitval</code> <code class="type">text</code>
</p>
<p>
<span class="original">
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.
</span>
遷移状態の初期値。
外部文字列表現での初期値を含んだテキストフィールド。
フィールドがNULL値の場合、推移状態はNULL値で始まります。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">aggminitval</code> <code class="type">text</code>
</p>
<p>
<span class="original">
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.
</span>
移動集約モードの、遷移状態の初期値。外部に文字列表記された初期値を含むテキストフィールド。
このフィールドがNULLの場合、遷移状態の値はNULLから始まります。
</p></td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
New aggregate functions are registered with the <link
linkend="sql-createaggregate"><command>CREATE AGGREGATE</command></link>
command. See <xref linkend="xaggr"/> for more information about
writing aggregate functions and the meaning of the transition
functions, etc.
</span>
新しい集約関数は<a class="link" href="sql-createaggregate.html" title="CREATE AGGREGATE"><code class="command">CREATE AGGREGATE</code></a>コマンドで登録されます。
集約関数の書き方や遷移関数の説明などの詳細は<a class="xref" href="xaggr.html" title="36.12. ユーザ定義の集約">36.12</a>を参照してください。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalogs-overview.html" title="52.1. 概要">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-am.html" title="52.3. pg_am">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">52.1. 概要 </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.3文書">ホーム</a></td><td width="40%" align="right" valign="top"> 52.3. <code class="structname">pg_am</code></td></tr></table></div></body></html>