sequence.
index 718037785c2972e3259d7a55586900f582f4d079..f6a2614f36d8339a2dfa1440c88e0822ad49fbca 100644 (file)
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.15 2000年12月08日 20:06:58 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.16 2001年06月23日 00:07:33 momjian Exp $
Postgres documentation
-->
<date>1999年07月20日</date>
</refsynopsisdivinfo>
<synopsis>
-CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable> [ INCREMENT <replaceable class="parameter">increment</replaceable> ]
+CREATE [ TEMPORARY | TEMP ] SEQUENCE <replaceable class="parameter">seqname</replaceable> [ INCREMENT <replaceable class="parameter">increment</replaceable> ]
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> ]
[ START <replaceable class="parameter">start</replaceable> ] [ CACHE <replaceable class="parameter">cache</replaceable> ] [ CYCLE ]
</synopsis>
@@ -37,6 +37,19 @@ CREATE SEQUENCE <replaceable class="parameter">seqname</replaceable> [ INCREMENT
</title>
<para>
+ <variablelist>
+ <varlistentry>
+ <term>TEMPORARY or TEMP</term>
+ <listitem>
+ <para>
+ If specified, the sequence is created only for this session, and is
+ automatically dropped on session exit.
+ Existing permanent sequences with the same name are not visible
+ (in this session) while the temporary sequence exists.
+ </para>
+ </listitem>
+ </varlistentry>
+
<variablelist>
<varlistentry>
<term><replaceable class="parameter">seqname</replaceable></term>
index 6861ee5c3d81a6c3c12531ed45667c75adb4694d..400c60b9b4616462834a5fd609d74fb334823c44 100644 (file)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.59 2001年06月13日 21:07:12 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.60 2001年06月23日 00:07:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
stmt->relname = seq->seqname;
+ stmt->istemp = seq->istemp;
stmt->inhRelnames = NIL;
stmt->constraints = NIL;
index c6f21e77b03be983c556726fa3c271b407c4b9e4..c0280c7b881a4fe200612ee5efda6f86df11f7e0 100644 (file)
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.189 2001年06月04日 23:27:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.190 2001年06月23日 00:07:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -779,6 +779,7 @@ transformCreateStmt(ParseState *pstate, CreateStmt *stmt)
sequence = makeNode(CreateSeqStmt);
sequence->seqname = pstrdup(sname);
+ sequence->istemp = stmt->istemp;
sequence->options = NIL;
elog(NOTICE, "CREATE TABLE will create implicit sequence '%s' for SERIAL column '%s.%s'",
@@ -2716,7 +2717,7 @@ transformAlterTableStmt(ParseState *pstate, AlterTableStmt *stmt)
return qry;
}
-/*
+/*
* Transform uses of %TYPE in a statement.
*/
static Node *
index e47c3f0b33153b005bc0e449ca9caae1e9929526..3c7d526a7b8fddd868e4247bd80d1365e7f15b2e 100644 (file)
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.231 2001年06月19日 22:39:11 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.232 2001年06月23日 00:07:34 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
*
*****************************************************************************/
-CreateSeqStmt: CREATE SEQUENCE relation_name OptSeqList
+CreateSeqStmt: CREATE OptTemp SEQUENCE relation_name OptSeqList
{
CreateSeqStmt *n = makeNode(CreateSeqStmt);
- n->seqname = 3ドル;
- n->options = 4ドル;
+ n->istemp = 2ドル;
+ n->seqname = 4ドル;
+ n->options = 5ドル;
$$ = (Node *)n;
}
;
index 43e64b6ad5f40bbd27341f6e00ba26c16a11b3e3..42b72e8074afb37dcbc23d395f2bfd344ae02ed3 100644 (file)
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.132 2001年06月19日 22:39:12 tgl Exp $
+ * $Id: parsenodes.h,v 1.133 2001年06月23日 00:07:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
{
NodeTag type;
char *seqname; /* the relation to create */
+ bool istemp; /* is this a temp sequence? */
List *options;
} CreateSeqStmt;
index c0b6c9c097d79a412ad4aeb3efd88cc296c554ea..2228c125d8a7aa8f02a7a91f6cd23032cb8851f6 100644 (file)
*
*****************************************************************************/
-CreateSeqStmt: CREATE SEQUENCE relation_name OptSeqList
+CreateSeqStmt: CREATE OptTemp SEQUENCE relation_name OptSeqList
{
- $$ = cat_str(3, make_str("create sequence"), 3,ドル 4ドル);
+ $$ = cat_str(4, make_str("create sequence"), 2,ドル 4,ドル 5ドル);
}
;