-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbki-commands.html
172 lines (172 loc) · 16.2 KB
/
bki-commands.html
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
<?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>67.4. BKIコマンド</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="bki-format.html" title="67.3. BKIファイル形式" /><link rel="next" href="bki-structure.html" title="67.5. BKIファイルのブートストラップの構成" /><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 17.0文書</a></th></tr><tr><td width="10%" align="left"></td><td width="10%" align="left"></td><td width="60%" align="center"><a href="bki.html" title="第67章 システムカタログの宣言と初期内容">第67章 システムカタログの宣言と初期内容</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 17.0 : bki-commands.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="bki-format.html" title="67.3. BKIファイル形式">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="bki.html" title="第67章 システムカタログの宣言と初期内容">上へ</a></td><td width="60%" align="center">67.4. <acronym class="acronym">BKI</acronym>コマンド</td><td width="20%" align="right"> <a accesskey="n" href="bki-structure.html" title="67.5. BKIファイルのブートストラップの構成">次へ</a></td></tr></table><hr /></div><div class="sect1" id="BKI-COMMANDS"><div class="titlepage"><div><div><h2 class="title" style="clear: both">67.4. <acronym class="acronym">BKI</acronym>コマンド <a href="#BKI-COMMANDS" class="id_link">#</a></h2></div></div></div><span class="original">
<title><acronym>BKI</acronym> Commands</title>
</span><div class="variablelist"><dl class="variablelist"><dt><span class="term">
<code class="literal">create</code>
<em class="replaceable"><code>tablename</code></em>
<em class="replaceable"><code>tableoid</code></em>
[<span class="optional"><code class="literal">bootstrap</code></span>]
[<span class="optional"><code class="literal">shared_relation</code></span>]
[<span class="optional"><code class="literal">rowtype_oid</code> <em class="replaceable"><code>oid</code></em></span>]
(<em class="replaceable"><code>name1</code></em> =
<em class="replaceable"><code>type1</code></em>
[<span class="optional"><code class="literal">FORCE NOT NULL</code> | <code class="literal">FORCE NULL</code> </span>] [<span class="optional">,
<em class="replaceable"><code>name2</code></em> =
<em class="replaceable"><code>type2</code></em>
[<span class="optional"><code class="literal">FORCE NOT NULL</code> | <code class="literal">FORCE NULL</code> </span>],
...</span>])
</span></dt><dd><p>
<span class="original">
Create a table named <replaceable
class="parameter">tablename</replaceable>, and having the OID
<replaceable class="parameter">tableoid</replaceable>,
with the columns given in parentheses.
</span>
括弧で与えられた列と、OID <em class="replaceable"><code>tableoid</code></em>を持つ<em class="replaceable"><code>tablename</code></em>というテーブルを作成します。
</p><p>
<span class="original">
The following column types are supported directly by
<filename>bootstrap.c</filename>: <type>bool</type>,
<type>bytea</type>, <type>char</type> (1 byte),
<type>name</type>, <type>int2</type>,
<type>int4</type>, <type>regproc</type>, <type>regclass</type>,
<type>regtype</type>, <type>text</type>,
<type>oid</type>, <type>tid</type>, <type>xid</type>,
<type>cid</type>, <type>int2vector</type>, <type>oidvector</type>,
<type>_int4</type> (array), <type>_text</type> (array),
<type>_oid</type> (array), <type>_char</type> (array),
<type>_aclitem</type> (array). Although it is possible to create
tables containing columns of other types, this cannot be done until
after <structname>pg_type</structname> has been created and filled with
appropriate entries. (That effectively means that only these
column types can be used in bootstrap catalogs, but non-bootstrap
catalogs can contain any built-in type.)
</span>
次の列型は<code class="filename">bootstrap.c</code>で直接サポートされます。
<code class="type">bool</code>、<code class="type">bytea</code>、<code class="type">char</code>(1バイト)、<code class="type">name</code>、<code class="type">int2</code>、<code class="type">int4</code>、<code class="type">regproc</code>、<code class="type">regclass</code>、<code class="type">regtype</code>、<code class="type">text</code>、<code class="type">oid</code>、<code class="type">tid</code>、<code class="type">xid</code>、<code class="type">cid</code>、<code class="type">int2vector</code>、<code class="type">oidvector</code>、<code class="type">_int4</code>(配列)、<code class="type">_text</code>(配列)、<code class="type">_oid</code>(配列)、<code class="type">_char</code>(配列)、<code class="type">_aclitem</code>(配列)。
この他の型の列を持つテーブルを作成することはできますが、<code class="structname">pg_type</code>が完了し適切な項目で埋められるまで完了させることができません。
(これらの列型のみブートストラップカタログで使用されますが、非ブートストラップカタログは如何なる組み込み型も含む事があるという事を実際に意味しています。)
</p><p>
<span class="original">
When <literal>bootstrap</literal> is specified,
the table will only be created on disk; nothing is entered into
<structname>pg_class</structname>,
<structname>pg_attribute</structname>, etc., for it. Thus the
table will not be accessible by ordinary SQL operations until
such entries are made the hard way (with <literal>insert</literal>
commands). This option is used for creating
<structname>pg_class</structname> etc. themselves.
</span>
<code class="literal">bootstrap</code>が指定された場合、テーブルはディスク上に作成されるだけで、<code class="structname">pg_class</code>や<code class="structname">pg_attribute</code>などにその項目は登録されません。
したがって、これらの項目が(<code class="literal">insert</code>コマンドで)固定化されるまで、普通のSQL操作でこのテーブルにアクセスできません。
このオプションは<code class="structname">pg_class</code>など自身を作成するために使用されます。
</p><p>
<span class="original">
The table is created as shared if <literal>shared_relation</literal> is
specified.
The table's row type OID (<structname>pg_type</structname> OID) can optionally
be specified via the <literal>rowtype_oid</literal> clause; if not specified,
an OID is automatically generated for it. (The <literal>rowtype_oid</literal>
clause is useless if <literal>bootstrap</literal> is specified, but it can be
provided anyway for documentation.)
</span>
<code class="literal">shared_relation</code>が指定された場合、テーブルは共有として作成されます。
テーブルの行型OID(<code class="structname">pg_type</code> OID)は<code class="literal">rowtype_oid</code>句で指定できます。
指定されなければ、OIDは自動的に生成されます。
(<code class="literal">bootstrap</code> が指定されていれば、<code class="literal">rowtype_oid</code>句は役に立ちません。しかし、文書化のためにともかく指定はできます。)
</p></dd><dt><span class="term">
<code class="literal">open</code> <em class="replaceable"><code>tablename</code></em>
</span></dt><dd><p>
<span class="original">
Open the table named
<replaceable class="parameter">tablename</replaceable>
for insertion of data. Any currently open table is closed.
</span>
データを挿入するために<em class="replaceable"><code>tablename</code></em>と名前が付けられたテーブルを開きます。
現在開いているテーブルは閉じられます。
</p></dd><dt><span class="term">
<code class="literal">close</code> <em class="replaceable"><code>tablename</code></em>
</span></dt><dd><p>
<span class="original">
Close the open table. The name of the table must be given as a
cross-check.
</span>
開いているテーブルを閉じます。
照合用にテーブル名を指定しなければなりません。
</p></dd><dt><span class="term">
<code class="literal">insert</code> <code class="literal">(</code> [<span class="optional"><em class="replaceable"><code>oid_value</code></em></span>] <em class="replaceable"><code>value1</code></em> <em class="replaceable"><code>value2</code></em> ... <code class="literal">)</code>
</span></dt><dd><p>
<span class="original">
Insert a new row into the open table using <replaceable
class="parameter">value1</replaceable>, <replaceable
class="parameter">value2</replaceable>, etc., for its column
values.
</span>
<em class="replaceable"><code>value1</code></em>や<em class="replaceable"><code>value2</code></em>などを列の値として、開いているテーブルに行を挿入します。
</p><p>
<span class="original">
NULL values can be specified using the special key word
<literal>_null_</literal>. Values that do not look like
identifiers or digit strings must be single-quoted.
(To include a single quote in a value, write it twice.
Escape-string-style backslash escapes are allowed in the string, too.)
</span>
NULL値は特別なキーワード、<code class="literal">_null_</code>によって指定できます。
識別子に見えない値、あるいは数値文字列は単一引用符で囲まなければなりません。
(単一引用符を値に含めるには、二重に書いてください。
エスケープ文字列形式のバックスラッシュエスケープも、文字列内で許されています。)
</p></dd><dt><span class="term">
<code class="literal">declare</code> [<span class="optional"><code class="literal">unique</code></span>]
<code class="literal">index</code> <em class="replaceable"><code>indexname</code></em>
<em class="replaceable"><code>indexoid</code></em>
<code class="literal">on</code> <em class="replaceable"><code>tablename</code></em>
<code class="literal">using</code> <em class="replaceable"><code>amname</code></em>
<code class="literal">(</code> <em class="replaceable"><code>opclass1</code></em>
<em class="replaceable"><code>name1</code></em>
[<span class="optional">, ...</span>] <code class="literal">)</code>
</span></dt><dd><p>
<span class="original">
Create an index named <replaceable
class="parameter">indexname</replaceable>, having OID
<replaceable class="parameter">indexoid</replaceable>,
on the table named
<replaceable class="parameter">tablename</replaceable>, using the
<replaceable class="parameter">amname</replaceable> access
method. The fields to index are called <replaceable
class="parameter">name1</replaceable>, <replaceable
class="parameter">name2</replaceable> etc., and the operator
classes to use are <replaceable
class="parameter">opclass1</replaceable>, <replaceable
class="parameter">opclass2</replaceable> etc., respectively.
The index file is created and appropriate catalog entries are
made for it, but the index contents are not initialized by this command.
</span>
<em class="replaceable"><code>amname</code></em>アクセスメソッドを使用して、<em class="replaceable"><code>tablename</code></em>と名付けられたテーブル上に、OID <em class="replaceable"><code>indexoid</code></em>を所有する、<em class="replaceable"><code>indexname</code></em>という名前のインデックスを作成します。
インデックスが付けられるフィールドは、<em class="replaceable"><code>name1</code></em>、<em class="replaceable"><code>name2</code></em>など、そして使用される演算子クラスは<em class="replaceable"><code>opclass1</code></em>、<em class="replaceable"><code>opclass2</code></em>などとそれぞれ呼ばれます。
このインデックスファイルは作成され、適切なカタログ項目が作成されますが、このコマンドではインデックスの内容の初期化を行いません。
</p></dd><dt><span class="term">
<code class="literal">declare toast</code>
<em class="replaceable"><code>toasttableoid</code></em>
<em class="replaceable"><code>toastindexoid</code></em>
<code class="literal">on</code> <em class="replaceable"><code>tablename</code></em>
</span></dt><dd><p>
<span class="original">
Create a TOAST table for the table named
<replaceable class="parameter">tablename</replaceable>.
The TOAST table is assigned OID
<replaceable class="parameter">toasttableoid</replaceable>
and its index is assigned OID
<replaceable class="parameter">toastindexoid</replaceable>.
As with <literal>declare index</literal>, filling of the index
is postponed.
</span>
<em class="replaceable"><code>tablename</code></em>という名前のテーブル用のTOASTテーブルを作成します。
このTOASTテーブルはOIDとして<em class="replaceable"><code>toasttableoid</code></em>が割り当てられ、そのインデックスはOIDとして<em class="replaceable"><code>toastindexoid</code></em>が割り当てられます。
<code class="literal">declare index</code>と同様、インデックスの作成は遅延されます。
</p></dd><dt><span class="term"><code class="literal">build indices</code></span></dt><dd><p>
<span class="original">
Fill in the indices that have previously been declared.
</span>
前に宣言されたインデックスを作成します。
</p></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bki-format.html" title="67.3. BKIファイル形式">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="bki.html" title="第67章 システムカタログの宣言と初期内容">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="bki-structure.html" title="67.5. BKIファイルのブートストラップの構成">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">67.3. <acronym class="acronym">BKI</acronym>ファイル形式 </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 17.0文書">ホーム</a></td><td width="40%" align="right" valign="top"> 67.5. <acronym class="acronym">BKI</acronym>ファイルのブートストラップの構成</td></tr></table></div></body></html>