Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
a0c12d5e
Commit
a0c12d5e
authored
Jun 23, 2001
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add TEMPORARY sequences and have SERIAL on a temp table have a temporary
sequence.
parent
280b5f4b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
12 deletions
+29
-12
doc/src/sgml/ref/create_sequence.sgml
doc/src/sgml/ref/create_sequence.sgml
+15
-2
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+2
-1
src/backend/parser/analyze.c
src/backend/parser/analyze.c
+3
-2
src/backend/parser/gram.y
src/backend/parser/gram.y
+5
-4
src/include/nodes/parsenodes.h
src/include/nodes/parsenodes.h
+2
-1
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+2
-2
No files found.
doc/src/sgml/ref/create_sequence.sgml
View file @
a0c12d5e
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.1
5 2000/12/08 20:06:58 tgl
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.1
6 2001/06/23 00:07:33 momjian
Exp $
Postgres documentation
-->
...
...
@@ -23,7 +23,7 @@ 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>
...
...
src/backend/commands/sequence.c
View file @
a0c12d5e
...
...
@@ -8,7 +8,7 @@
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -161,6 +161,7 @@ DefineSequence(CreateSeqStmt *seq)
}
stmt
->
relname
=
seq
->
seqname
;
stmt
->
istemp
=
seq
->
istemp
;
stmt
->
inhRelnames
=
NIL
;
stmt
->
constraints
=
NIL
;
...
...
src/backend/parser/analyze.c
View file @
a0c12d5e
...
...
@@ -6,7 +6,7 @@
* 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.1
89 2001/06/04 23:27:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.1
90 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
*
...
...
src/backend/parser/gram.y
View file @
a0c12d5e
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.23
1 2001/06/19 22:39:11 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.23
2 2001/06/23 00:07:34 momjian
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -1574,11 +1574,12 @@ CreateAsElement: ColId
*
*****************************************************************************/
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;
}
;
...
...
src/include/nodes/parsenodes.h
View file @
a0c12d5e
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.13
2 2001/06/19 22:39:12 tgl
Exp $
* $Id: parsenodes.h,v 1.13
3 2001/06/23 00:07:34 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -402,6 +402,7 @@ typedef struct CreateSeqStmt
{
NodeTag
type
;
char
*
seqname
;
/* the relation to create */
bool
istemp
;
/* is this a temp sequence? */
List
*
options
;
}
CreateSeqStmt
;
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
a0c12d5e
...
...
@@ -1289,9 +1289,9 @@ CreateAsElement: ColId { $$ = $1; }
*
*****************************************************************************/
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
);
}
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment