-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-class.html
More file actions
260 lines (260 loc) · 25.7 KB
/
catalog-pg-class.html
File metadata and controls
260 lines (260 loc) · 25.7 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
<?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>51.11. pg_class</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="catalog-pg-cast.html" title="51.10. pg_cast" /><link rel="next" href="catalog-pg-collation.html" title="51.12. pg_collation" /><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 12.4文書</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="第51章 システムカタログ">第51章 システムカタログ</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 12.4 catalog-pg-class.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-cast.html" title="51.10. pg_cast">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第51章 システムカタログ">上へ</a></td><td width="60%" align="center">51.11. <code class="structname">pg_class</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-collation.html" title="51.12. pg_collation">次へ</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-CLASS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">51.11. <code class="structname">pg_class</code></h2></div></div></div><a id="id-1.10.4.13.2" class="indexterm"></a><p>
<span class="original">
The catalog <structname>pg_class</structname> catalogs tables and most
everything else that has columns or is otherwise similar to a
table. This includes indexes (but see also
<structname>pg_index</structname>), sequences (but see also
<structname>pg_sequence</structname>), views, materialized
views, composite types, and TOAST tables; see <structfield>relkind</structfield>.
Below, when we mean all of these
kinds of objects we speak of <quote>relations</quote>. Not all
columns are meaningful for all relation types.
</span>
<code class="structname">pg_class</code>カタログはテーブルと、その他に列を持つもの、あるいはテーブルに似た全てのものを目録にしています。
その中にはインデックス(<code class="structname">pg_index</code>も参照)、シーケンス(<code class="structname">pg_sequence</code>も参照)、ビュー、マテリアライズドビュー、複合型およびTOASTテーブルが含まれます。
<code class="structfield">relkind</code>を参照してください。
これより以降、<span class="quote">「<span class="quote">リレーション</span>」</span>と記されている場合はこれらすべてのオブジェクトを意味しています。
すべての列が全てのリレーションの型に該当するとは限りません。
</p><div class="table" id="id-1.10.4.13.4"><p class="title"><strong>表51.11 <code class="structname">pg_class</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_class</structname> Columns</title>
</span><table class="table" summary="pg_classの列" 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">oid</code></td><td><code class="type">oid</code></td><td> </td><td>行識別子</td></tr><tr><td><code class="structfield">relname</code></td><td><code class="type">name</code></td><td> </td><td>テーブル、インデックス、ビューなどの名前</td></tr><tr><td><code class="structfield">relnamespace</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-namespace.html" title="51.32. pg_namespace"><code class="structname">pg_namespace</code></a>.oid</code></td><td>
<span class="original">
The OID of the namespace that contains this relation
</span>
このリレーションを持つ名前空間のOID
</td></tr><tr><td><code class="structfield">reltype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="51.63. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>
<span class="original">
The OID of the data type that corresponds to this table's row type,
if any (zero for indexes, which have no <structname>pg_type</structname> entry)
</span>
もし何らかの(<code class="structname">pg_type</code>項目を持たないインデックスではゼロ)が存在した場合このテーブルの行の型に対応するデータ型のOID
</td></tr><tr><td><code class="structfield">reloftype</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-type.html" title="51.63. pg_type"><code class="structname">pg_type</code></a>.oid</code></td><td>
<span class="original">
For typed tables, the OID of the underlying composite type,
zero for all other relations
</span>
型付けされたテーブルでは背後にある複合型のOID。
その他のリレーションではゼロ。
</td></tr><tr><td><code class="structfield">relowner</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-authid.html" title="51.8. pg_authid"><code class="structname">pg_authid</code></a>.oid</code></td><td>リレーションの所有者</td></tr><tr><td><code class="structfield">relam</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-am.html" title="51.3. pg_am"><code class="structname">pg_am</code></a>.oid</code></td><td>
<span class="original">
If this is a table or an index, the access method used (heap,
B-tree, hash, etc.)
</span>
これがテーブルあるいはインデックスの場合は、それに使われている(ヒープ、B-tree、ハッシュなどの)アクセスメソッド
</td></tr><tr><td><code class="structfield">relfilenode</code></td><td><code class="type">oid</code></td><td> </td><td>このリレーションのディスク上のファイルの名前です。
ゼロはディスク上のファイル名が低レベルな状態で決定される<span class="quote">「<span class="quote">マップ付けされた</span>」</span>リレーションであることを意味します。</td></tr><tr><td><code class="structfield">reltablespace</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-tablespace.html" title="51.55. pg_tablespace"><code class="structname">pg_tablespace</code></a>.oid</code></td><td>
<span class="original">
The tablespace in which this relation is stored. If zero,
the database's default tablespace is implied. (Not meaningful
if the relation has no on-disk file.)
</span>
このリレーションが保存されているテーブル空間。
もしゼロならば、このデータベースのデフォルトテーブル空間を意味します。
(リレーションがディスク上のファイルになくても、問題はありません。)
</td></tr><tr><td><code class="structfield">relpages</code></td><td><code class="type">int4</code></td><td> </td><td>
<span class="original">
Size of the on-disk representation of this table in pages (of size
<symbol>BLCKSZ</symbol>). This is only an estimate used by the
planner. It is updated by <command>VACUUM</command>,
<command>ANALYZE</command>, and a few DDL commands such as
<command>CREATE INDEX</command>.
</span>
このテーブルのディスク上におけるページ単位(<code class="symbol">BLCKSZ</code>)の表現サイズ。
これはプランナで使用される単なる推測値です。
<code class="command">VACUUM</code>、<code class="command">ANALYZE</code>および<code class="command">CREATE INDEX</code>コマンドなどの一部のDDLコマンドで更新されます。
</td></tr><tr><td><code class="structfield">reltuples</code></td><td><code class="type">float4</code></td><td> </td><td>
<span class="original">
Number of live rows in the table. This is only an estimate used by
the planner. It is updated by <command>VACUUM</command>,
<command>ANALYZE</command>, and a few DDL commands such as
<command>CREATE INDEX</command>.
</span>
テーブル内の生きている行数。
これはプランナで使用される単なる推測値です。
<code class="command">VACUUM</code>、<code class="command">ANALYZE</code>、<code class="command">CREATE INDEX</code>などの一部のDDLコマンドで更新されます。
</td></tr><tr><td><code class="structfield">relallvisible</code></td><td><code class="type">int4</code></td><td> </td><td>
<span class="original">
Number of pages that are marked all-visible in the table's
visibility map. This is only an estimate used by the
planner. It is updated by <command>VACUUM</command>,
<command>ANALYZE</command>, and a few DDL commands such as
<command>CREATE INDEX</command>.
</span>
テーブル内の可視マップ内で全て可視とマークされているページ数。
これはプランナで使用される単なる見積です。
これは<code class="command">VACUUM</code>、<code class="command">ANALYZE</code>さらに<code class="command">CREATE INDEX</code>といったいくつかのDDLコマンドで更新されます。
</td></tr><tr><td><code class="structfield">reltoastrelid</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-class.html" title="51.11. pg_class"><code class="structname">pg_class</code></a>.oid</code></td><td>
<span class="original">
OID of the TOAST table associated with this table, 0 if none. The
TOAST table stores large attributes <quote>out of line</quote> in a
secondary table.
</span>
このテーブルに関連しているTOASTテーブルのOID。
何もない場合はゼロです。
TOASTテーブルは<span class="quote">「<span class="quote">行に収まらない</span>」</span>大きい属性を副テーブルに格納します。
</td></tr><tr><td><code class="structfield">relhasindex</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if this is a table and it has (or recently had) any indexes
</span>
テーブルであり、かつ、インデックスを持つ(あるいはつい最近まで持っていた)時は真。
</td></tr><tr><td><code class="structfield">relisshared</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if this table is shared across all databases in the cluster. Only
certain system catalogs (such as <structname>pg_database</structname>)
are shared.
</span>
クラスタ内の全てのデータベースにわたってこのテーブルが共有されている場合は真。
(<code class="structname">pg_database</code>のような)ある特定のシステムカタログのみ共有されます。
</td></tr><tr><td><code class="structfield">relpersistence</code></td><td><code class="type">char</code></td><td> </td><td>
<span class="original">
<literal>p</literal> = permanent table, <literal>u</literal> = unlogged table,
<literal>t</literal> = temporary table
</span>
<code class="literal">p</code>は永続テーブル、<code class="literal">u</code>はログを取らないテーブル、<code class="literal">t</code>は一時テーブルを表します。
</td></tr><tr><td><code class="structfield">relkind</code></td><td><code class="type">char</code></td><td> </td><td>
<span class="original">
<literal>r</literal> = ordinary table,
<literal>i</literal> = index,
<literal>S</literal> = sequence,
<literal>t</literal> = TOAST table,
<literal>v</literal> = view,
<literal>m</literal> = materialized view,
<literal>c</literal> = composite type,
<literal>f</literal> = foreign table,
<literal>p</literal> = partitioned table,
<literal>I</literal> = partitioned index
</span>
<code class="literal">r</code>は通常のテーブル、<code class="literal">i</code>はインデックス、<code class="literal">S</code>はシーケンス、<code class="literal">t</code>はTOASTテーブル、<code class="literal">v</code>はビュー、<code class="literal">m</code>はマテリアライズドビュー、<code class="literal">c</code>は複合型、<code class="literal">f</code>は外部テーブル、<code class="literal">p</code>はパーティションテーブル、<code class="literal">I</code>はpartitioned indexを表します。
</td></tr><tr><td><code class="structfield">relnatts</code></td><td><code class="type">int2</code></td><td> </td><td>
<span class="original">
Number of user columns in the relation (system columns not
counted). There must be this many corresponding entries in
<structname>pg_attribute</structname>. See also
<literal>pg_attribute.attnum</literal>.
</span>
リレーションにあるユーザ列数(システム列は含みません)。
<code class="structname">pg_attribute</code>にこれに対応する数多くの項目があるはずです。
<code class="literal">pg_attribute.attnum</code>も参照してください。
</td></tr><tr><td><code class="structfield">relchecks</code></td><td><code class="type">int2</code></td><td> </td><td>
<span class="original">
Number of <literal>CHECK</literal> constraints on the table; see
<link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link> catalog
</span>
テーブル上の<code class="literal">CHECK</code>制約の数。
<a class="link" href="catalog-pg-constraint.html" title="51.13. pg_constraint"><code class="structname">pg_constraint</code></a>カタログを参照してください。
</td></tr><tr><td><code class="structfield">relhasrules</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if table has (or once had) rules; see
<link linkend="catalog-pg-rewrite"><structname>pg_rewrite</structname></link> catalog
</span>
もしテーブルにルールがある(あるいは以前あった)場合に真。
<a class="link" href="catalog-pg-rewrite.html" title="51.44. pg_rewrite"><code class="structname">pg_rewrite</code></a>カタログを参照してください。
</td></tr><tr><td><code class="structfield">relhastriggers</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if table has (or once had) triggers; see
<link linkend="catalog-pg-trigger"><structname>pg_trigger</structname></link> catalog
</span>
もしテーブルにトリガがある(あるいは以前あった)場合に真。
<a class="link" href="catalog-pg-trigger.html" title="51.57. pg_trigger"><code class="structname">pg_trigger</code></a>カタログを参照してください。
</td></tr><tr><td><code class="structfield">relhassubclass</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if table or index has (or once had) any inheritance children
</span>
もしテーブルあるいはインデックスが子テーブルに継承されている(または以前に継承されていた)場合は真。
</td></tr><tr><td><code class="structfield">relrowsecurity</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if table has row level security enabled; see
<link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
</span>
行単位セキュリティが有効なテーブルでは真。
<a class="link" href="catalog-pg-policy.html" title="51.38. pg_policy"><code class="structname">pg_policy</code></a>カタログを参照。
</td></tr><tr><td><code class="structfield">relforcerowsecurity</code></td><td><code class="type">bool</code></td><td> </td><td>
<span class="original">
True if row level security (when enabled) will also apply to table owner; see
<link linkend="catalog-pg-policy"><structname>pg_policy</structname></link> catalog
</span>
行単位セキュリティが(有効にされているとして)テーブルの所有者にも適用されるなら真。
<a class="link" href="catalog-pg-policy.html" title="51.38. pg_policy"><code class="structname">pg_policy</code></a>カタログを参照。
</td></tr><tr><td><code class="structfield">relispopulated</code></td><td><code class="type">bool</code></td><td> </td><td>リレーションにデータが投入されている場合に真(マテリアライズドビュー以外のすべてのリレーションでは真です。)</td></tr><tr><td><code class="structfield">relreplident</code></td><td><code class="type">char</code></td><td> </td><td>
<span class="original">
Columns used to form <quote>replica identity</quote> for rows:
<literal>d</literal> = default (primary key, if any),
<literal>n</literal> = nothing,
<literal>f</literal> = all columns,
<literal>i</literal> = index with
<structfield>indisreplident</structfield> set (same as nothing if the
index used has been dropped)
</span>
行に<span class="quote">「<span class="quote">replica identity</span>」</span>フォームを使った列。
<code class="literal">d</code> デフォルト(もしあれば主キー)、
<code class="literal">n</code> 無し、
<code class="literal">f</code> 全ての列、
<code class="literal">i</code> インデックスと <code class="structfield">indisreplident</code>のセット(使用されていたインデックスが削除されていた場合は、無し、と同様)
</td></tr><tr><td><code class="structfield">relispartition</code></td><td><code class="type">bool</code></td><td> </td><td>テーブルあるいはインデックスがパーティションなら真</td></tr><tr><td><code class="structfield">relrewrite</code></td><td><code class="type">oid</code></td><td><code class="literal"><a class="link" href="catalog-pg-class.html" title="51.11. pg_class"><code class="structname">pg_class</code></a>.oid</code></td><td>
<span class="original">
For new relations being written during a DDL operation that requires a
table rewrite, this contains the OID of the original relation;
otherwise 0. That state is only visible internally; this field should
never contain anything other than 0 for a user-visible relation.
</span>
テーブルの書き換えが必要なDDL操作中に書き込みが行われる新しいリレーションでは、これは元のリレーションのOIDを持ちます。
この状態は内部的にのみ可視です。
このフィールドはユーザから見えるリレーションでは0以外を持つべきではありません。
</td></tr><tr><td><code class="structfield">relfrozenxid</code></td><td><code class="type">xid</code></td><td> </td><td>
<span class="original">
All transaction IDs before this one have been replaced with a permanent
(<quote>frozen</quote>) transaction ID in this table. This is used to track
whether the table needs to be vacuumed in order to prevent transaction
ID wraparound or to allow <literal>pg_xact</literal> to be shrunk. Zero
(<symbol>InvalidTransactionId</symbol>) if the relation is not a table.
</span>
この値より以前のトランザクションIDはすべて、このテーブルで永続的な(<span class="quote">「<span class="quote">凍結された</span>」</span>)トランザクションIDに置き換えられています。
これは、このテーブルに対して、トランザクションID周回を防ぎ、かつ、<code class="literal">pg_xact</code>を縮小させることを目的としたバキュームを行うかどうかを追跡するために使用されます。
リレーションがテーブルではない場合は0(<code class="symbol">InvalidTransactionId</code>)です。
</td></tr><tr><td><code class="structfield">relminmxid</code></td><td><code class="type">xid</code></td><td> </td><td>
<span class="original">
All multixact IDs before this one have been replaced by a
transaction ID in this table. This is used to track
whether the table needs to be vacuumed in order to prevent multixact ID
wraparound or to allow <literal>pg_multixact</literal> to be shrunk. Zero
(<symbol>InvalidMultiXactId</symbol>) if the relation is not a table.
</span>
このテーブル内のトランザクションIDによって置換される前のすべてのマルチトランザクションID。
これは、マルチトランザクションIDのID周回を防ぐ、または<code class="literal">pg_multixact</code>を縮小させるために、テーブルをバキュームする必要があるかどうかを追跡するために使用されます。
リレーションがテーブルではない場合はゼロ(<code class="symbol">InvalidMultiXactId</code>)です。
</td></tr><tr><td><code class="structfield">relacl</code></td><td><code class="type">aclitem[]</code></td><td> </td><td>
<span class="original">
Access privileges; see <xref linkend="ddl-priv"/> for details
</span>
アクセス権限。
詳細は<a class="xref" href="ddl-priv.html" title="5.7. 権限">5.7</a>を参照してください。
</td></tr><tr><td><code class="structfield">reloptions</code></td><td><code class="type">text[]</code></td><td> </td><td>
<span class="original">
Access-method-specific options, as <quote>keyword=value</quote> strings
</span>
<span class="quote">「<span class="quote">keyword=value</span>」</span>文字列のような、アクセスメソッド特有のオプション。
</td></tr><tr><td><code class="structfield">relpartbound</code></td><td><code class="type">pg_node_tree</code></td><td> </td><td>
<span class="original">
If table is a partition (see <structfield>relispartition</structfield>),
internal representation of the partition bound
</span>
テーブルがパーティションの場合(<code class="structfield">relispartition</code>参照)のパーティション境界の内部表現。
</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
Several of the Boolean flags in <structname>pg_class</structname> are maintained
lazily: they are guaranteed to be true if that's the correct state, but
may not be reset to false immediately when the condition is no longer
true. For example, <structfield>relhasindex</structfield> is set by
<command>CREATE INDEX</command>, but it is never cleared by
<command>DROP INDEX</command>. Instead, <command>VACUUM</command> clears
<structfield>relhasindex</structfield> if it finds the table has no indexes. This
arrangement avoids race conditions and improves concurrency.
</span>
<code class="structname">pg_class</code>内の複数の論理型フラグは、ゆっくりと保守されます。
正しい状態にあるときに真であることが保証されていますが、その条件が真でなくなった時即座に偽に再設定されないかもしれません。
例えば<code class="structfield">relhasindex</code>は<code class="command">CREATE INDEX</code>で設定されますが、<code class="command">DROP INDEX</code>では決して初期化されません。
代わりに<code class="command">VACUUM</code>がそのテーブルにインデックスがないことを判定した場合に<code class="structfield">relhasindex</code>を初期化します。
この調整により競合状態を防止し、同時実行性が向上します。
</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalog-pg-cast.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-collation.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">51.10. <code class="structname">pg_cast</code> </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> 51.12. <code class="structname">pg_collation</code></td></tr></table></div></body></html>