.\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... .\" $Header: /usr/local/cvsroot/pgsql/src/man/create_sequence.l,v 1.3 1998/01/11 22:17:17 momjian Exp $ .\" Translated by Mitsuhiro Maeda (mitsu@cni.co.jp) .TH "CREATE SEQUENCE" SQL 04/01/97 日本語PostgreSQL 日本語PostgreSQL .SH 名称 .\" create sequence - create a new sequence number generator create sequence - 新しいシーケンスを作ります .SH 形式 .nf \fBcreate sequence\fR seqname [\fBincrement\fP incby_value] [\fBminvalue\fP min_value] [\fBmaxvalue\fP max_value] [\fBstart\fP start_value] [\fBcache\fP cache_value] [\fBcycle\fP] .fi .SH 説明 .\" .BR "Create sequence" .\" will enter a new sequence number generator into the current data base. .BR "create sequence" は新しいシーケンスを現在のデータベースに入れます。 .\" Actually, new single block .\" .BR table .\" with name .\" .IR seqname .\" will be created and initialized. 実際には単一ブロックの .IR seqname という名前の .BR 表 をを新しく作って初期化します。 .\" The generator will be .\" \*(lqowned\*(rq by the user issuing the command. シーケンスはコマンドを発行したユーザの \*(lq所有\*(rq になります。 .PP .\" The .\" .BR "increment" .\" is optional clause. .BR "increment" はオプションの句です。 .\" Positive value will make ascending sequence, .\" negative - descending. Default value is 1. 正の値は正順のシーケンス、 負の値は逆順のシーケンスになります。 デフォルトの値は 1です。 .PP .\" The optional integer .\" .BR minvalue .\" determines the minimum value a sequence can be. オプションの整数 .BR minvalue はシーケンスの取る最小値を決定します。 .\" Defaults are .\" 1/-2147483647 for ascending/descending sequences. デフォルトは正順のシーケンスが 1、逆順が -2147483647です。 .PP .\" Use optional integer .\" .BR maxvalue .\" to determine the maximum value for sequence. Defaults are .\" 2147483647/-1 for ascending/descending sequences. オプションの整数 .BR maxvalue はシーケンスの最大値を決定します。 デフォルトは正順のシーケンスが 2147483647、逆順が -1です。 .PP .\" The optinal .\" .BR "start" .\" value enables sequence to begin anywhere. オプションの .BR "start" 値はシーケンスがどこから始まるかを決めます。 .\" Default is .\" .BR minvalue .\" for ascending sequences and .\" .BR maxvalue .\" for descending ones. デフォルトでは正順のシーケンスが .BR minvalue で、逆順が .BR maxvalue となります。 .PP .\" The .\" .BR cache .\" option enables sequence numbers to be preallocated and .\" stored in memory for faster access. .BR cache オプションは連続番号が先にアロケートされてメモリに保存されて、 高速アクセスが可能となります。 .\" The minimum value is 1 .\" (i.e. - no cache) and it is default. 最小値は 1 (つまりキャッシュしません)で、 これがデフォルトとなります。 .\" .BR NOTE: .\" each backend uses own cache to store allocated numbers. .BR 注意: 各バックエンドはそれぞれにアロケートした数をキャッシュします。 .\" Cached but not used in current session numbers will be lost. 現在のセッションでキャッシュされても使われなかった数は捨てられます。 .PP .\" The optional .\" .BR cycle .\" keyword may be used to enable sequence to continue when the .\" .BR maxvalue/minvalue .\" has been reached by ascending/descending sequence. オプションの .BR cycle キーワードは正順/逆順のシーケンスが .BR maxvalue/minvalue に達した時に、そのまま続けることを可能にします。 .\" If the limit is reached, the next number generated will be .\" whatever the .\" .BR minvalue/maxvalue .\" is. もしリミットに達すると、 次に発生する数は .BR minvalue/maxvalue になります。 .PP .\" After sequence created, You may use function .\" .BR nextval .\" with sequence name as argument to get new number from sequence .\" specified. シーケンスが作られると、関数 .BR nextval にシーケンス名を引数に付けて、 指定したシーケンスから新しい数を得るように使うことができます。 .\" Function .\" .BR currval .\" ('sequence_name') .\" may be used to determine number returned by last call to .\" .BR nextval .\" for specified sequence in current session. 関数 .BR currval ('シーケンス名') を使うことで指定したシーケンスが現在のセッションで最後の .BR nextval の呼び出しに戻した数を見ることができます。 .PP .nf .\" Use query like シーケンスのパラメータを得る問い合わせは select * from ; .\" to get parameters of a sequence. のようになります。 .fi .PP .\" Low-level locking is used to enable multiple simultaneous calls .\" to a generator. シーケンスへの複数の同時の呼び出しを可能とするために、 低レベルのロックが使われます。 .PP .SH 例 .nf -- .\" -- Create sequence seq caching 2 numbers, starting with 10 -- 2つの数をキャッシュして 10から始まる seq というシーケンスを作ります -- create sequence seq cache 2 start 10; .fi .nf -- .\" -- Select next number from sequence -- シーケンスから次の番号を選択します -- select nextval ('seq'); .fi .nf -- .\" -- Use sequence in insert -- 挿入にシーケンスを使います。 -- insert into table _table_ values (nextval ('seq'),...); .fi .SH 参照 drop sequence(l).