1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
16 HREF="sql-commands.html"><LINK
19 HREF="sql-alterschema.html"><LINK
22 HREF="sql-altertable.html"><LINK
25 HREF="stylesheet.css"><META
27 CONTENT="2003-12-22T03:48:47"></HEAD
33 SUMMARY="Header navigation table"
43 >PostgreSQL 7.4.1 Documentation</TH
51 HREF="sql-alterschema.html"
60 HREF="sql-alterschema.html"
73 HREF="sql-altertable.html"
81 HREF="sql-altertable.html"
92 NAME="SQL-ALTERSEQUENCE"
103 -- alter the definition of a sequence generator
109 CLASS="REFSYNOPSISDIV"
120 > [ INCREMENT [ BY ] <VAR
127 > | NO MINVALUE ] [ MAXVALUE <VAR
131 [ RESTART [ WITH ] <VAR
151 > changes the parameters of an existing
152 sequence generator. Any parameter not specifically set in the
156 > command retains its prior setting.
179 > The name (optionally schema-qualified) of a sequence to be altered.
196 optional. A positive value will make an ascending sequence, a
197 negative one a descending sequence. If unspecified, the old
198 increment value will be maintained.
211 > The optional clause <TT
218 the minimum value a sequence can generate. If <TT
222 > is specified, the defaults of 1 and
225 >-1 for ascending and descending sequences,
226 respectively, will be used. If neither option is specified,
227 the current minimum value will be maintained.
240 > The optional clause <TT
247 the maximum value for the sequence. If <TT
251 > is specified, the defaults are
254 >-1 and -1 for ascending and descending
255 sequences, respectively, will be used. If neither option is
256 specified, the current maximum value will be maintained.
266 > The optional clause <TT
273 current value of the sequence.
290 sequence numbers to be preallocated and stored in memory for
291 faster access. The minimum value is 1 (only one value can be
292 generated at a time, i.e., no cache). If unspecified, the old
293 cache value will be maintained.
303 > key word may be used to enable
304 the sequence to wrap around when the
314 an ascending or descending sequence respectively. If the limit is
315 reached, the next number generated will be the
331 > If the optional <TT
335 specified, any calls to <CODE
339 sequence has reached its maximum value will return an error.
347 > are specified, the old cycle behaviour will be
364 > Restart a sequence called <TT
369 CLASS="PROGRAMLISTING"
370 >ALTER SEQUENCE serial RESTART WITH 105;</PRE
382 > To avoid blocking of concurrent transactions that obtain numbers from the
386 > is never rolled back;
387 the changes take effect immediately and are not reversible.
393 > will not immediately affect
397 > results in backends,
398 other than the current one, that have preallocated (cached) sequence
399 values. They will use up all cached values prior to noticing the changed
400 sequence parameters. The current backend will be affected immediately.
444 SUMMARY="Footer navigation table"
455 HREF="sql-alterschema.html"
473 HREF="sql-altertable.html"
489 HREF="sql-commands.html"