Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
b5ee45e1
Commit
b5ee45e1
authored
28 years ago
by
Vadim B. Mikheev
Browse files
Options
Downloads
Patches
Plain Diff
Manuals for SEQUENCEs.
parent
2b788e0b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/man/create_sequence.l
+114
-0
114 additions, 0 deletions
src/man/create_sequence.l
src/man/drop_sequence.l
+15
-0
15 additions, 0 deletions
src/man/drop_sequence.l
with
129 additions
and
0 deletions
src/man/create_sequence.l
0 → 100644
+
114
−
0
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).
This diff is collapsed.
Click to expand it.
src/man/drop_sequence.l
0 → 100644
+
15
−
0
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).
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment