-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbki-commands.html
More file actions
147 lines (147 loc) · 16.1 KB
/
Copy pathbki-commands.html
File metadata and controls
147 lines (147 loc) · 16.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
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
<?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.2. BKIコマンド</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="bki-format.html" title="67.1. BKIファイル形式" /><link rel="next" href="bki-structure.html" title="67.3. BKIファイルのブートストラップの構成" /><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 10.5文書</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章 BKIバックエンドインタフェース">第67章 <acronym class="acronym">BKI</acronym>バックエンドインタフェース</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 10.5 bki-commands.html">誤訳等の報告
</a></div></td></tr><tr><td width="10%" align="left"><a accesskey="p" href="bki-format.html" title="67.1. BKIファイル形式">前へ</a> </td><td width="10%" align="left"><a accesskey="u" href="bki.html" title="第67章 BKIバックエンドインタフェース">上へ</a></td><td width="60%" align="center">67.2. <acronym class="acronym">BKI</acronym>コマンド</td><td width="20%" align="right"> <a accesskey="n" href="bki-structure.html" title="67.3. 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.2. <acronym class="acronym">BKI</acronym>コマンド</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">without_oids</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">FORCE NOT NULL | FORCE NULL </span>] [<span class="optional">,
<em class="replaceable"><code>name2</code></em> =
<em class="replaceable"><code>type2</code></em>
[<span class="optional">FORCE NOT NULL | FORCE NULL </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</>: <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</> has been created and filled with
appropriate entries. (That effectively means that only these
column types can be used in bootstrapped tables, 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</> 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</>
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</> is
specified.
It will have OIDs unless <literal>without_oids</> is specified.
The table's row type OID (<structname>pg_type</> OID) can optionally
be specified via the <literal>rowtype_oid</> clause; if not specified,
an OID is automatically generated for it. (The <literal>rowtype_oid</>
clause is useless if <literal>bootstrap</> is specified, but it can be
provided anyway for documentation.)
</span><code class="literal">shared_relation</code>が指定された場合、テーブルは作成されます。
<code class="literal">without_oids</code>が指定されていない限りテーブルはOIDを持ちます。
テーブルの行型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> [<span class="optional"><em class="replaceable"><code>tablename</code></em></span>]
</span></dt><dd><p><span class="original">
Close the open table. The name of the table can be given as a
cross-check, but this is not required.
</span>開いているテーブルを閉じます。
テーブル名は照合用に指定可能ですが、必須ではありません。
</p></dd><dt><span class="term"> <code class="literal">insert</code> [<span class="optional"><code class="literal">OID =</code> <em class="replaceable"><code>oid_value</code></em></span>] <code class="literal">(</code> <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 and <replaceable
class="parameter">oid_value</replaceable> for its OID. If
<replaceable class="parameter">oid_value</replaceable> is zero
(0) or the clause is omitted, and the table has OIDs, then the
next available OID is assigned.
</span><em class="replaceable"><code>value1</code></em>や<em class="replaceable"><code>value2</code></em>などを列の値として、<em class="replaceable"><code>oid_value</code></em>をOIDとし、開いているテーブルに行を挿入します。
もし<em class="replaceable"><code>oid_value</code></em>がゼロ(0)、もしくは句が省略され、テーブルがOIDを所有していれば、次の有効なOIDが割り当てられます。
</p><p><span class="original">
NULL values can be specified using the special key word
<literal>_null_</literal>. Values containing spaces must be
double quoted.
</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</>, 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">前へ</a> </td><td width="20%" align="center"><a accesskey="u" href="bki.html">上へ</a></td><td width="40%" align="right"> <a accesskey="n" href="bki-structure.html">次へ</a></td></tr><tr><td width="40%" align="left" valign="top">67.1. <acronym class="acronym">BKI</acronym>ファイル形式 </td><td width="20%" align="center"><a accesskey="h" href="index.html">ホーム</a></td><td width="40%" align="right" valign="top"> 67.3. <acronym class="acronym">BKI</acronym>ファイルのブートストラップの構成</td></tr></table></div></body></html>