create
tablename
tableoid
[bootstrap]
[shared_relation]
[rowtype_oid oid]
(name1 =
type1
[FORCE NOT NULL | FORCE NULL ] [,
name2 =
type2
[FORCE NOT NULL | FORCE NULL ],
...])
Create a table named <replaceable
class="parameter">tablename</replaceable>, and having the OID
<replaceable class="parameter">tableoid</replaceable>,
with the columns given in parentheses.
括弧で与えられた列と、OID tableoidを持つtablenameというテーブルを作成します。
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.)
次の列型はbootstrap.cで直接サポートされます。
bool、bytea、char(1バイト)、name、int2、int4、regproc、regclass、regtype、text、oid、tid、xid、cid、int2vector、oidvector、_int4(配列)、_text(配列)、_oid(配列)、_char(配列)、_aclitem(配列)。
この他の型の列を持つテーブルを作成することはできますが、pg_typeが完了し適切な項目で埋められるまで完了させることができません。
(これらの列型のみブートストラップカタログで使用されますが、非ブートストラップカタログは如何なる組み込み型も含む事があるという事を実際に意味しています。)
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.
bootstrapが指定された場合、テーブルはディスク上に作成されるだけで、pg_classやpg_attributeなどにその項目は登録されません。
したがって、これらの項目が(insertコマンドで)固定化されるまで、普通のSQL操作でこのテーブルにアクセスできません。
このオプションはpg_classなど自身を作成するために使用されます。
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.)
shared_relationが指定された場合、テーブルは共有として作成されます。
テーブルの行型OID(pg_type OID)はrowtype_oid句で指定できます。
指定されなければ、OIDは自動的に生成されます。
(bootstrap が指定されていれば、rowtype_oid句は役に立ちません。しかし、文書化のためにともかく指定はできます。)
open tablename
Open the table named
<replaceable class="parameter">tablename</replaceable>
for insertion of data. Any currently open table is closed.
データを挿入するためにtablenameと名前が付けられたテーブルを開きます。
現在開いているテーブルは閉じられます。
close tablename
Close the open table. The name of the table must be given as a cross-check. 開いているテーブルを閉じます。 照合用にテーブル名を指定しなければなりません。
insert ( [oid_value] value1 value2 ... )
Insert a new row into the open table using <replaceable
class="parameter">value1</replaceable>, <replaceable
class="parameter">value2</replaceable>, etc., for its column
values.
value1やvalue2などを列の値として、開いているテーブルに行を挿入します。
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.)
NULL値は特別なキーワード、_null_によって指定できます。
識別子に見えない値、あるいは数値文字列は単一引用符で囲まなければなりません。
(単一引用符を値に含めるには、二重に書いてください。
エスケープ文字列形式のバックスラッシュエスケープも、文字列内で許されています。)
declare [unique]
index indexname
indexoid
on tablename
using amname
( opclass1
name1
[, ...] )
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.
amnameアクセスメソッドを使用して、tablenameと名付けられたテーブル上に、OID indexoidを所有する、indexnameという名前のインデックスを作成します。
インデックスが付けられるフィールドは、name1、name2など、そして使用される演算子クラスはopclass1、opclass2などとそれぞれ呼ばれます。
このインデックスファイルは作成され、適切なカタログ項目が作成されますが、このコマンドではインデックスの内容の初期化を行いません。
declare toast
toasttableoid
toastindexoid
on tablename
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.
tablenameという名前のテーブル用のTOASTテーブルを作成します。
このTOASTテーブルはOIDとしてtoasttableoidが割り当てられ、そのインデックスはOIDとしてtoastindexoidが割り当てられます。
declare indexと同様、インデックスの作成は遅延されます。
build indicesFill in the indices that have previously been declared. 前に宣言されたインデックスを作成します。