-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-attribute.html
More file actions
340 lines (340 loc) · 23.9 KB
/
catalog-pg-attribute.html
File metadata and controls
340 lines (340 loc) · 23.9 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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<?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.7. pg_attribute</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="catalog-pg-attrdef.html" title="52.6. pg_attrdef" /><link rel="next" href="catalog-pg-authid.html" title="52.8. pg_authid" /><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-attribute.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-attrdef.html" title="52.6. pg_attrdef">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="60%" align="center">52.7. <code class="structname">pg_attribute</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-authid.html" title="52.8. pg_authid">次へ</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-ATTRIBUTE"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.7. <code class="structname">pg_attribute</code> <a href="#CATALOG-PG-ATTRIBUTE" class="id_link">#</a></h2></div></div></div><a id="id-1.10.4.9.2" class="indexterm"></a><p>
<span class="original">
The catalog <structname>pg_attribute</structname> stores information about
table columns. There will be exactly one
<structname>pg_attribute</structname> row for every column in every
table in the database. (There will also be attribute entries for
indexes, and indeed all objects that have
<link linkend="catalog-pg-class"><structname>pg_class</structname></link>
entries.)
</span>
<code class="structname">pg_attribute</code>カタログにはテーブルの列情報が格納されます。
データベース内のすべてのテーブルの各列に対し必ず1つの<code class="structname">pg_attribute</code>行があります。
(また、インデックスと<a class="link" href="catalog-pg-class.html" title="52.11. pg_class"><code class="structname">pg_class</code></a>に項目を持つすべてのオブジェクトに対しての属性記述があります。)
</p><p>
<span class="original">
The term attribute is equivalent to column and is used for
historical reasons.
</span>
属性という表現は列と同等の意味で、歴史的背景からそのように呼ばれています。
</p><div class="table" id="id-1.10.4.9.5"><p class="title"><strong>表52.7 <code class="structname">pg_attribute</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_attribute</structname> Columns</title>
</span><table class="table" summary="pg_attributeの列" 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">attrelid</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-class"><structname>pg_class</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-class.html" title="52.11. pg_class"><code class="structname">pg_class</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
The table this column belongs to
</span>
この列が属するテーブル
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attname</code> <code class="type">name</code>
</p>
<p>
<span class="original">
The column name
</span>
列名
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">atttypid</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">
The data type of this column (zero for a dropped column)
</span>
この列のデータ型(ゼロなら削除された列)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attlen</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
A copy of <literal>pg_type.typlen</literal> of this column's
type
</span>
この列の型の<code class="literal">pg_type.typlen</code>のコピー
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attnum</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
The number of the column. Ordinary columns are numbered from 1
up. System columns, such as <structfield>ctid</structfield>,
have (arbitrary) negative numbers.
</span>
列番号。
通常の列には1から始まる番号付けがなされます。
<code class="structfield">ctid</code>のようなシステムによる列には(任意の)負の番号が付きます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">atttypmod</code> <code class="type">int4</code>
</p>
<p>
<span class="original">
<structfield>atttypmod</structfield> records type-specific data
supplied at table creation time (for example, the maximum
length of a <type>varchar</type> column). It is passed to
type-specific input functions and length coercion functions.
The value will generally be -1 for types that do not need <structfield>atttypmod</structfield>.
</span>
<code class="structfield">atttypmod</code>は、テーブル作成時に与えられた型固有のデータ(たとえば<code class="type">varchar</code>列の最大長)を記録します。
これは型固有の入力関数や長さ強制関数に渡されます。
<code class="structfield">atttypmod</code>を必要としない型では、通常、この値は-1です。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attndims</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
Number of dimensions, if the column is an array type; otherwise 0.
(Presently, the number of dimensions of an array is not enforced,
so any nonzero value effectively means <quote>it's an array</quote>.)
</span>
列が配列型の場合は次元数を表現し、そうでない時はゼロです。
(現在配列の次元数は強制されていませんのでゼロ以外のどのような値であっても<span class="quote">「<span class="quote">これは配列である</span>」</span>ということを意味します。)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attbyval</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
A copy of <literal>pg_type.typbyval</literal> of this column's type
</span>
この列の型の<code class="literal">pg_type.typbyval</code>のコピー
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attalign</code> <code class="type">char</code>
</p>
<p>
<span class="original">
A copy of <literal>pg_type.typalign</literal> of this column's type
</span>
この列の型の<code class="literal">pg_type.typalign</code>のコピー
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attstorage</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Normally a copy of <literal>pg_type.typstorage</literal> of this
column's type. For TOAST-able data types, this can be altered
after column creation to control storage policy.
</span>
通常、この列の型の<code class="literal">pg_type.typstorage</code>のコピー。
TOAST可能なデータ型では、格納ポリシーを制御するために列の作成後に変更できます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attcompression</code> <code class="type">char</code>
</p>
<p>
<span class="original">
The current compression method of the column. Typically this is
<literal>'\0'</literal> to specify use of the current default setting
(see <xref linkend="guc-default-toast-compression"/>). Otherwise,
<literal>'p'</literal> selects pglz compression, while
<literal>'l'</literal> selects <productname>LZ4</productname>
compression. However, this field is ignored
whenever <structfield>attstorage</structfield> does not allow
compression.
</span>
この列の現在の圧縮方式。
典型的には現在のデフォルト設定(<a class="xref" href="runtime-config-client.html#GUC-DEFAULT-TOAST-COMPRESSION">default_toast_compression</a>参照)を指定する<code class="literal">'\0'</code>です。
そうでなければ、<code class="literal">'p'</code>はpglz圧縮を選択し、<code class="literal">'l'</code>は<span class="productname">LZ4</span>圧縮を選択します。
ただし、<code class="structfield">attstorage</code>が圧縮を許可しなければ、このフィールドは無視されます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attnotnull</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This column has a (possibly invalid) not-null constraint.
</span>
この列には非NULL制約(無効なこともあります)があります。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">atthasdef</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This column has a default expression or generation expression, in which
case there will be a corresponding entry in the
<link linkend="catalog-pg-attrdef"><structname>pg_attrdef</structname></link> catalog that actually defines the
expression. (Check <structfield>attgenerated</structfield> to
determine whether this is a default or a generation expression.)
</span>
この列にはデフォルト値あるいは生成式があります。
その場合、実際に値を定義する<a class="link" href="catalog-pg-attrdef.html" title="52.6. pg_attrdef"><code class="structname">pg_attrdef</code></a>カタログ内に対応する項目があります。
(これがデフォルトなのか生成式なのかは<code class="structfield">attgenerated</code>をチェックします。)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">atthasmissing</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This column has a value which is used where the column is entirely
missing from the row, as happens when a column is added with a
non-volatile <literal>DEFAULT</literal> value after the row is created.
The actual value used is stored in the
<structfield>attmissingval</structfield> column.
</span>
この列は、行から列の値が完全に失われている場合に使われる値を持ちます。
これは、行が作られた後で非不安定(non-volatile)な<code class="literal">DEFAULT</code>値を持つ列が追加される際に起こります。
実際に使われる値は<code class="structfield">attmissingval</code>列に格納されています。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attidentity</code> <code class="type">char</code>
</p>
<p>
<span class="original">
If a zero byte (<literal>''</literal>), then not an identity column.
Otherwise, <literal>a</literal> = generated
always, <literal>d</literal> = generated by default.
</span>
ゼロバイト(<code class="literal">''</code>)ならこれは識別列ではありません。
識別列では、 <code class="literal">a</code> = GENERATED ALWAYS、 <code class="literal">d</code> = GENERATED BY DEFAULTになります。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attgenerated</code> <code class="type">char</code>
</p>
<p>
<span class="original">
If a zero byte (<literal>''</literal>), then not a generated column.
Otherwise, <literal>s</literal> = stored, <literal>v</literal> =
virtual. A stored generated column is physically stored like a normal
column. A virtual generated column is physically stored as a null
value, with the actual value being computed at run time.
</span>
ゼロバイト(<code class="literal">''</code>)ならこれは生成列ではありません。
生成列では、<code class="literal">s</code> = 格納生成列、<code class="literal">v</code> = 仮想生成列になります。
格納生成列は、通常の列と同様に物理的に格納されます。
仮想生成列は、物理的にはNULL値として格納され、実際の値は実行時に計算されます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attisdropped</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This column has been dropped and is no longer valid. A dropped
column is still physically present in the table, but is
ignored by the parser and so cannot be accessed via SQL.
</span>
この列は既に削除されていて有効ではありません。
削除された列は物理的にはまだテーブル上に存在していますが、パーサによって無視されるためSQLでアクセスできません。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attislocal</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This column is defined locally in the relation. Note that a column can
be locally defined and inherited simultaneously.
</span>
この列はリレーション内でローカルに定義されます。
列がローカルに定義されると同時に継承される場合もあることに注意してください。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attinhcount</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
The number of direct ancestors this column has. A column with a
nonzero number of ancestors cannot be dropped nor renamed.
</span>
この列が持つ直接の祖先の数です。
祖先を持っている列の削除や名前は変更はできません。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attcollation</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-collation"><structname>pg_collation</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-collation.html" title="52.12. pg_collation"><code class="structname">pg_collation</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
The defined collation of the column, or zero if the column is
not of a collatable data type
</span>
列で定義された照合順序。列が照合順序の設定ができないデータ型の場合はゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attstattarget</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
<structfield>attstattarget</structfield> controls the level of detail
of statistics accumulated for this column by
<link linkend="sql-analyze"><command>ANALYZE</command></link>.
A zero value indicates that no statistics should be collected.
A null value says to use the system default statistics target.
The exact meaning of positive values is data type-dependent.
For scalar data types, <structfield>attstattarget</structfield>
is both the target number of <quote>most common values</quote>
to collect, and the target number of histogram bins to create.
</span>
<code class="structfield">attstattarget</code>は<a class="link" href="sql-analyze.html" title="ANALYZE"><code class="command">ANALYZE</code></a>によるこの列に対する蓄積された統計情報をどの程度詳しく管理するかを規定します。
値がゼロの場合は統計情報を収集しません。
NULL値の場合は、システムのデフォルトの統計目標を使用すべきであるということです。
正の値が厳密に意味するところはデータ型に依存します。
スカラデータ型に対して<code class="structfield">attstattarget</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">attacl</code> <code class="type">aclitem[]</code>
</p>
<p>
<span class="original">
Column-level access privileges, if any have been granted specifically
on this column
</span>
この列に特定して付与された場合における、列レベルのアクセス権限
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attoptions</code> <code class="type">text[]</code>
</p>
<p>
<span class="original">
Attribute-level options, as <quote>keyword=value</quote> strings
</span>
<span class="quote">「<span class="quote">keyword=value</span>」</span>文字列のような、属性レベルのオプション
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attfdwoptions</code> <code class="type">text[]</code>
</p>
<p>
<span class="original">
Attribute-level foreign data wrapper options, as <quote>keyword=value</quote> strings
</span>
<span class="quote">「<span class="quote">keyword=value</span>」</span>文字列のような、外部データラッパーオプションの属性レベル
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">attmissingval</code> <code class="type">anyarray</code>
</p>
<p>
<span class="original">
This column has a one element array containing the value used when the
column is entirely missing from the row, as happens when the column is
added with a non-volatile <literal>DEFAULT</literal> value after the
row is created. The value is only used when
<structfield>atthasmissing</structfield> is true. If there is no value
the column is null.
</span>
この列は、行から列の値が完全に失われている場合に使われる値を持つ一要素配列を持ちます。
これは、行が作られた後で非不安定(non-volatile)な<code class="literal">DEFAULT</code>値を持つ列が追加される際に起こります。
この値は<code class="structfield">atthasmissing</code>がtrueのときだけ使用されます。
値がなければその列はNULLになります。
</p></td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
In a dropped column's <structname>pg_attribute</structname> entry,
<structfield>atttypid</structfield> is reset to zero, but
<structfield>attlen</structfield> and the other fields copied from
<link linkend="catalog-pg-type"><structname>pg_type</structname></link> are still valid. This arrangement is needed
to cope with the situation where the dropped column's data type was
later dropped, and so there is no <structname>pg_type</structname> row anymore.
<structfield>attlen</structfield> and the other fields can be used
to interpret the contents of a row of the table.
</span>
削除された列の<code class="structname">pg_attribute</code>項目では、<code class="structfield">atttypid</code>はゼロにリセットされます。
しかし<code class="structfield">attlen</code>と<a class="link" href="catalog-pg-type.html" title="52.64. pg_type"><code class="structname">pg_type</code></a>からコピーされた他のフィールドは、有効なままです。
この動作は、削除された列のデータ型が後になって削除されて、<code class="structname">pg_type</code>行が存在しないような状況の場合に必要です。
<code class="structfield">attlen</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-attrdef.html" title="52.6. pg_attrdef">前へ</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-authid.html" title="52.8. pg_authid">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">52.6. <code class="structname">pg_attrdef</code> </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.8. <code class="structname">pg_authid</code></td></tr></table></div></body></html>