-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog-pg-constraint.html
More file actions
392 lines (392 loc) · 24.5 KB
/
catalog-pg-constraint.html
File metadata and controls
392 lines (392 loc) · 24.5 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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<?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.13. pg_constraint</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-collation.html" title="52.12. pg_collation" /><link rel="next" href="catalog-pg-conversion.html" title="52.14. pg_conversion" /><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-constraint.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="catalog-pg-collation.html" title="52.12. pg_collation">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="catalogs.html" title="第52章 システムカタログ">上へ</a></td><td width="60%" align="center">52.13. <code class="structname">pg_constraint</code></td><td width="20%" align="right"> <a accesskey="n" href="catalog-pg-conversion.html" title="52.14. pg_conversion">次へ</a></td></tr></table><hr /></div><div class="sect1" id="CATALOG-PG-CONSTRAINT"><div class="titlepage"><div><div><h2 class="title" style="clear: both">52.13. <code class="structname">pg_constraint</code> <a href="#CATALOG-PG-CONSTRAINT" class="id_link">#</a></h2></div></div></div><a id="id-1.10.4.15.2" class="indexterm"></a><p>
<span class="original">
The catalog <structname>pg_constraint</structname> stores check, not-null,
primary key, unique, foreign key, and exclusion constraints on tables.
(Column constraints are not treated specially. Every column constraint is
equivalent to some table constraint.)
</span>
<code class="structname">pg_constraint</code>カタログは、テーブル上の検査制約、非NULL制約、主キー制約、一意性制約、外部キー制約、および排他制約を格納します。
(列制約は特別扱いされていません。全ての列制約は何らかのテーブル制約と同等です。)
</p><p>
<span class="original">
User-defined constraint triggers (created with <link linkend="sql-createtrigger">
<command>CREATE CONSTRAINT TRIGGER</command></link>) also give rise to an entry in this table.
</span>
(<a class="link" href="sql-createtrigger.html" title="CREATE TRIGGER"><code class="command">CREATE CONSTRAINT TRIGGER</code></a>で作成される)ユーザ定義の制約トリガもこのテーブルの項目の元になります。
</p><p>
<span class="original">
Check constraints on domains are stored here, too.
</span>
ドメイン上の検査制約もここに格納されます。
</p><div class="table" id="id-1.10.4.15.6"><p class="title"><strong>表52.13 <code class="structname">pg_constraint</code>の列</strong></p><div class="table-contents"><span class="original">
<title><structname>pg_constraint</structname> Columns</title>
</span><table class="table" summary="pg_constraintの列" 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">oid</code> <code class="type">oid</code>
</p>
<p>
<span class="original">
Row identifier
</span>
行識別子
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conname</code> <code class="type">name</code>
</p>
<p>
<span class="original">
Constraint name (not necessarily unique!)
</span>
制約名(一意である必要はありません!)
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">connamespace</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-namespace.html" title="52.32. pg_namespace"><code class="structname">pg_namespace</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
The OID of the namespace that contains this constraint
</span>
この制約を含む名前空間のOID
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">contype</code> <code class="type">char</code>
</p>
<p>
<span class="original">
<literal>c</literal> = check constraint,
<literal>f</literal> = foreign key constraint,
<literal>n</literal> = not-null constraint,
<literal>p</literal> = primary key constraint,
<literal>u</literal> = unique constraint,
<literal>t</literal> = constraint trigger,
<literal>x</literal> = exclusion constraint
</span>
<code class="literal">c</code> = 検査制約、
<code class="literal">f</code> = 外部キー制約、
<code class="literal">n</code> = 非NULL制約、
<code class="literal">p</code> = 主キー制約、
<code class="literal">u</code> = 一意性制約、
<code class="literal">t</code> = 制約トリガ、
<code class="literal">x</code> = 排他制約
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">condeferrable</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
Is the constraint deferrable?
</span>
制約は遅延可能かどうか?
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">condeferred</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
Is the constraint deferred by default?
</span>
制約はデフォルトで遅延可能かどうか?
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conenforced</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
Is the constraint enforced?
</span>
制約は強制されているか?
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">convalidated</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
Has the constraint been validated?
</span>
制約は検証されたか?
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conrelid</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 constraint is on; zero if not a table constraint
</span>
この制約が存在しているテーブル。
テーブル制約でなければゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">contypid</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 domain this constraint is on; zero if not a domain constraint
</span>
この制約が存在しているドメイン。
ドメイン制約でなければゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conindid</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 index supporting this constraint, if it's a unique, primary
key, foreign key, or exclusion constraint; else zero
</span>
一意性制約、主キー制約、外部キー制約、排他制約の場合、この制約をサポートするインデックス。
そうでなければゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conparentid</code> <code class="type">oid</code>
<span class="original">
(references <link linkend="catalog-pg-constraint"><structname>pg_constraint</structname></link>.<structfield>oid</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-constraint.html" title="52.13. pg_constraint"><code class="structname">pg_constraint</code></a>.<code class="structfield">oid</code>)
</p>
<p>
<span class="original">
The corresponding constraint of the parent partitioned table,
if this is a constraint on a partition; else zero
</span>
パーティション内の制約なら、親パーティションテーブルの該当制約。
そうでなければゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confrelid</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">
If a foreign key, the referenced table; else zero
</span>
外部キーであれば、参照されるテーブル。
そうでなければゼロ
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confupdtype</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Foreign key update action code:
<literal>a</literal> = no action,
<literal>r</literal> = restrict,
<literal>c</literal> = cascade,
<literal>n</literal> = set null,
<literal>d</literal> = set default
</span>
外部キー更新アクションコード:
<code class="literal">a</code> = no action,
<code class="literal">r</code> = restrict,
<code class="literal">c</code> = cascade,
<code class="literal">n</code> = set null,
<code class="literal">d</code> = set default
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confdeltype</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Foreign key deletion action code:
<literal>a</literal> = no action,
<literal>r</literal> = restrict,
<literal>c</literal> = cascade,
<literal>n</literal> = set null,
<literal>d</literal> = set default
</span>
外部キー削除アクションコード:
<code class="literal">a</code> = no action,
<code class="literal">r</code> = restrict,
<code class="literal">c</code> = cascade,
<code class="literal">n</code> = set null,
<code class="literal">d</code> = set default
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confmatchtype</code> <code class="type">char</code>
</p>
<p>
<span class="original">
Foreign key match type:
<literal>f</literal> = full,
<literal>p</literal> = partial,
<literal>s</literal> = simple
</span>
外部キーの一致型:
<code class="literal">f</code> = full,
<code class="literal">p</code> = partial,
<code class="literal">s</code> = simple
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conislocal</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This constraint is defined locally for the relation. Note that a
constraint can be locally defined and inherited simultaneously.
</span>
この制約はリレーションでローカルに定義されています。制約はローカルに定義されていて同時に継承されます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">coninhcount</code> <code class="type">int2</code>
</p>
<p>
<span class="original">
The number of direct inheritance ancestors this constraint has.
A constraint 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">connoinherit</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This constraint is defined locally for the relation. It is a
non-inheritable constraint.
</span>
この制約はリレーションのためにローカルで定義されます。これは非継承制約です。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conperiod</code> <code class="type">bool</code>
</p>
<p>
<span class="original">
This constraint is defined with <literal>WITHOUT OVERLAPS</literal>
(for primary keys and unique constraints) or <literal>PERIOD</literal>
(for foreign keys).
</span>
この制約は<code class="literal">WITHOUT OVERLAPS</code>(主キーと一意性制約の場合)または<code class="literal">PERIOD</code>(外部キーの場合)で定義されています。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conkey</code> <code class="type">int2[]</code>
<span class="original">
(references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-attribute.html" title="52.7. pg_attribute"><code class="structname">pg_attribute</code></a>.<code class="structfield">attnum</code>)
</p>
<p>
<span class="original">
If a table constraint (including foreign keys, but not constraint
triggers), list of the constrained columns
</span>
テーブル制約(外部キーを含みますが制約トリガは含みません)であれば、その制約によって制約される列のリスト
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confkey</code> <code class="type">int2[]</code>
<span class="original">
(references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-attribute.html" title="52.7. pg_attribute"><code class="structname">pg_attribute</code></a>.<code class="structfield">attnum</code>)
</p>
<p>
<span class="original">
If a foreign key, list of the referenced columns
</span>
外部キーであれば、参照される列のリスト
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conpfeqop</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">
If a foreign key, list of the equality operators for PK = FK comparisons
</span>
外部キーであれば、PK = FKの比較のための同値演算子のリスト
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conppeqop</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">
If a foreign key, list of the equality operators for PK = PK comparisons
</span>
外部キーであれば、PK = PKの比較のための同値演算子のリスト
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conffeqop</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">
If a foreign key, list of the equality operators for FK = FK comparisons
</span>
外部キーであれば、FK = FKの比較のための同値演算子のリスト
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">confdelsetcols</code> <code class="type">int2[]</code>
<span class="original">
(references <link linkend="catalog-pg-attribute"><structname>pg_attribute</structname></link>.<structfield>attnum</structfield>)
</span>
(参照先 <a class="link" href="catalog-pg-attribute.html" title="52.7. pg_attribute"><code class="structname">pg_attribute</code></a>.<code class="structfield">attnum</code>)
</p>
<p>
<span class="original">
If a foreign key with a <literal>SET NULL</literal> or <literal>SET
DEFAULT</literal> delete action, the columns that will be updated.
If null, all of the referencing columns will be updated.
</span>
外部キーに<code class="literal">SET NULL</code>または<code class="literal">SET DEFAULT</code>削除アクションがある場合、更新される列。
NULLの場合、参照しているすべての列が更新されます。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conexclop</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">
If an exclusion constraint or <literal>WITHOUT OVERLAPS</literal>
primary key/unique constraint, list of the per-column exclusion operators.
</span>
排他制約または<code class="literal">WITHOUT OVERLAPS</code>の主キー/一意制約であれば、列ごとの排他演算子のリスト。
</p></td></tr><tr><td class="catalog_table_entry"><p class="column_definition">
<code class="structfield">conbin</code> <code class="type">pg_node_tree</code>
</p>
<p>
<span class="original">
If a check constraint, an internal representation of the
expression. (It's recommended to use
<function>pg_get_constraintdef()</function> to extract the definition of
a check constraint.)
</span>
チェック制約なら式の内部表現。(<code class="function">pg_get_constraintdef()</code>を使ってチェック制約の定義を取り出すことをお勧めします。)
</p></td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="original">
In the case of an exclusion constraint, <structfield>conkey</structfield>
is only useful for constraint elements that are simple column references.
For other cases, a zero appears in <structfield>conkey</structfield>
and the associated index must be consulted to discover the expression
that is constrained. (<structfield>conkey</structfield> thus has the
same contents as <link linkend="catalog-pg-index"><structname>pg_index</structname></link>.<structfield>indkey</structfield> for the
index.)
</span>
排他制約の場合、単純な列参照である制約要素でのみ<code class="structfield">conkey</code>が有用です。
その他の場合、<code class="structfield">conkey</code>はゼロであり、関連するインデックスは制約される式を調査して見つけなければなりません。
(したがってインデックスでは<code class="structfield">conkey</code>は<a class="link" href="catalog-pg-index.html" title="52.26. pg_index"><code class="structname">pg_index</code></a>.<code class="structfield">indkey</code>の内容と同じものを持ちます。)
</p><div class="note"><h3 class="title">注記</h3><p>
<span class="original">
<literal>pg_class.relchecks</literal> needs to agree with the
number of check-constraint entries found in this table for each
relation.
</span>
<code class="literal">pg_class.relchecks</code>はそれぞれのリレーションに対してこのテーブルで検出された検査制約の項目数と一致しなければなりません。
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="catalog-pg-collation.html" title="52.12. pg_collation">前へ</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-conversion.html" title="52.14. pg_conversion">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">52.12. <code class="structname">pg_collation</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.14. <code class="structname">pg_conversion</code></td></tr></table></div></body></html>