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
b5ee45e1
Commit
b5ee45e1
authored
Apr 02, 1997
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Manuals for SEQUENCEs.
parent
2b788e0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
0 deletions
+129
-0
src/man/create_sequence.l
src/man/create_sequence.l
+114
-0
src/man/drop_sequence.l
src/man/drop_sequence.l
+15
-0
No files found.
src/man/create_sequence.l
0 → 100644
View file @
b5ee45e1
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/create_sequence.l,v 1.1 1997/04/02 04:19:58 vadim Exp $
.TH "CREATE SEQUENCE" SQL 04/01/97 PostgreSQL PostgreSQL
.SH NAME
create sequence \(em create a new sequence number generator
.SH SYNOPSIS
.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 DESCRIPTION
.BR "Create sequence"
will enter a new sequence number generator into the current data base.
Actually, new single block
.BR table
with name
.IR seqname
will be created and initialized.
The generator will be
\*(lqowned\*(rq by the user issuing the command.
.PP
The
.BR "increment"
is optional clause. Positive value will make ascending sequence,
negative - descending. Default value is 1.
.PP
The optional integer
.BR minvalue
determines the minimum value a sequence can be. Defaults are
1/-2147483647 for ascending/descending sequences.
.PP
Use optional integer
.BR maxvalue
to determine the maximum value for sequence. Defaults are
2147483647/-1 for ascending/descending sequences.
.PP
The optinal
.BR "start"
value enables sequence to begin anywhere. Default is
.BR minvalue
for ascending sequences and
.BR maxvalue
for descending ones.
.PP
The
.BR cache
option enables sequence numbers to be preallocated and
stored in memory for faster access. The minimum value is 1
(i.e. - no cache) and it is default.
.BR NOTE:
each backend uses own cache to store allocated numbers.
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.
If the limit is reached, the next number generated will be
whatever the
.BR minvalue/maxvalue
is.
.PP
After sequence created, You may use function
.BR nextval
with sequence name as argument to get new number from sequence
specified.
To determine the current sequence number use function
.BR currval
('sequence_name').
.BR NOTE:
after sequence creation You are to call
.BR nextval
before first call to
.BR currval.
.PP
.nf
Use query like
select * from <sequence_name>;
to get parameters of a sequence.
.fi
.PP
Low-level locking is used to enable multiple simultaneous calls
to a generator.
.PP
.SH EXAMPLES
.nf
--
-- Create sequence seq caching 2 numbers, starting with 10
--
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 "SEE ALSO"
drop sequence(l).
src/man/drop_sequence.l
0 → 100644
View file @
b5ee45e1
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/drop_sequence.l,v 1.1 1997/04/02 04:20:00 vadim Exp $
.TH "DROP TABLE" SQL 04/01/97 PostgreSQL PostgreSQL
.SH NAME
drop sequence \(em destroy existing sequence
.SH SYNOPSIS
.nf
\fBdrop sequence\fR sequence_name_1 { \fB,\fR sequence_name_N }
.fi
.SH DESCRIPTION
.BR "Drop Sequence"
removes sequence number generators from the data base.
With current implementation of sequences as special tables it
works just like \fBdrop table\fR(l).
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