-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-aggregate.html
More file actions
63 lines (63 loc) · 13.1 KB
/
catalog-pg-aggregate.html
File metadata and controls
63 lines (63 loc) · 13.1 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
<?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 V1.79.1" /><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><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="4" align="center"><a accesskey="h" href="index.html">PostgreSQL 11.5文書</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?title=version 11.5 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></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 <structname>pg_proc</structname>. 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>内の項目の拡張です。
<code class="structname">pg_proc</code>の項目には、集約の名前、入出力データ型および通常の関数と類似したその他の情報が含まれます。
</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 /><col /><col /><col /></colgroup><thead><tr><th>名前</th><th>型</th><th>参照先</th><th>説明</th></tr></thead><tbody><tr><td><code class="structfield">aggfnoid</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>集約関数の<code class="structname">pg_proc</code> OID</td></tr><tr><td><code class="structfield">aggkind</code></td><td><code class="type">char</code></td><td> </td><td>集約関数の種類:
<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>集約関数
</td></tr><tr><td><code class="structfield">aggnumdirectargs</code></td><td><code class="type">int2</code></td><td> </td><td>
順序集合や仮想集合の集約関数では、(集約されていない)複数の引数は、可変長配列として1個の引数と見なします。
引数が数が<code class="structfield">pronargs</code>と同じ場合、最終的な直接引数同様、集約された引数として、集約関数の引数は、可変または可変長配列で記述しなければなりません。
通常の集約関数は引数を取りません。</td></tr><tr><td><code class="structfield">aggtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>遷移関数</td></tr><tr><td><code class="structfield">aggfinalfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>最終関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggcombinefn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>結合関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggserialfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>直列化関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggdeserialfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>逆直列化関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggmtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>移動集約モードの順方向遷移関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggminvtransfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>移動集約モードの逆遷移関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggmfinalfn</code></td><td><code class="type">regproc</code></td><td><code class="literal"><a class="link" href="catalog-pg-proc.html" title="52.39. pg_proc"><code class="structname">pg_proc</code></a>.oid</code></td><td>移動集約モードの最終関数(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggfinalextra</code></td><td><code class="type">bool</code></td><td> </td><td><code class="structfield">aggfinalfn</code>に追加の仮引数を渡す場合はTrue</td></tr><tr><td><code class="structfield">aggmfinalextra</code></td><td><code class="type">bool</code></td><td> </td><td><code class="structfield">aggmfinalfn</code>に追加の仮引数を渡す場合はTrue</td></tr><tr><td><code class="structfield">aggfinalmodify</code></td><td><code class="type">char</code></td><td> </td><td><code class="structfield">aggfinalfn</code>が遷移状態値を変更するかどうか。
読み出し専用なら<code class="literal">r</code>、<code class="structfield">aggfinalfn</code>の後で<code class="structfield">aggtransfn</code>を適用できなければ<code class="literal">s</code>、その値に書き込むなら<code class="literal">w</code>。
</td></tr><tr><td><code class="structfield">aggmfinalmodify</code></td><td><code class="type">char</code></td><td> </td><td><code class="structfield">aggmfinalfn</code>用であることを除き、<code class="structfield">aggfinalmodify</code>と同様。
</td></tr><tr><td><code class="structfield">aggsortop</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-operator.html" title="52.34. pg_operator"><code class="structname">pg_operator</code></a>.oid</code></td><td>関連するソート演算子(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggtranstype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="52.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>集約関数の内部遷移(状態)データのデータ型</td></tr><tr><td><code class="structfield">aggtransspace</code></td><td><code class="type">int4</code></td><td> </td><td>遷移状態データの推定平均サイズ(バイト)、またはデフォルトの推定値であるゼロ</td></tr><tr><td><code class="structfield">aggmtranstype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="52.62. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>移動集約モードの、集約関数の内部遷移(状態)データのデータ型(ない時はゼロ)</td></tr><tr><td><code class="structfield">aggmtransspace</code></td><td><code class="type">int4</code></td><td> </td><td>移動集約モードの、遷移状態データの推定平均サイズ(バイト)、またはデフォルトの推定値であるゼロ</td></tr><tr><td><code class="structfield">agginitval</code></td><td><code class="type">text</code></td><td> </td><td>
<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値で始まります。
</td></tr><tr><td><code class="structfield">aggminitval</code></td><td><code class="type">text</code></td><td> </td><td>
<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から始まります。
</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
New aggregate functions are registered with the <xref
linkend="sql-createaggregate"/>
command. See <xref linkend="xaggr"/> for more information about
writing aggregate functions and the meaning of the transition
functions, etc.
</span>
新しい集約関数は<a class="xref" href="sql-createaggregate.html" title="CREATE AGGREGATE"><span class="refentrytitle">CREATE AGGREGATE</span></a>コマンドで登録されます。
集約関数の書き方や遷移関数の説明などの詳細は<a class="xref" href="xaggr.html" title="38.11. ユーザ定義の集約">38.11</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">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="catalogs.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="catalog-pg-am.html">次へ</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">ホーム</a></td><td width="40%" align="right" valign="top"> 52.3. <code class="structname">pg_am</code></td></tr></table></div></body></html>