aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/alter_sequence.sgml29
1 files changed, 23 insertions, 6 deletions
diff --git a/doc/src/sgml/ref/alter_sequence.sgml b/doc/src/sgml/ref/alter_sequence.sgml
index 31e64dac35d..7cf69e9ea3f 100644
--- a/doc/src/sgml/ref/alter_sequence.sgml
+++ b/doc/src/sgml/ref/alter_sequence.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.20 2008/05/16 23:36:04 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.21 2008/05/17 01:20:39 tgl Exp $
PostgreSQL documentation
-->
@@ -26,7 +26,9 @@ PostgreSQL documentation
<synopsis>
ALTER SEQUENCE <replaceable class="parameter">name</replaceable> [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
- [ RESTART [ [ WITH ] <replaceable class="parameter">start</replaceable> ] ] [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
+ [ START [ WITH ] <replaceable class="parameter">start</replaceable> ]
+ [ RESTART [ [ WITH ] <replaceable class="parameter">restart</replaceable> ] ]
+ [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
[ OWNED BY { <replaceable class="parameter">table</replaceable>.<replaceable class="parameter">column</replaceable> | NONE } ]
ALTER SEQUENCE <replaceable class="parameter">name</replaceable> RENAME TO <replaceable class="parameter">new_name</replaceable>
ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <replaceable class="parameter">new_schema</replaceable>
@@ -112,15 +114,29 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
<term><replaceable class="parameter">start</replaceable></term>
<listitem>
<para>
+ The optional clause <literal>START WITH <replaceable
+ class="parameter">start</replaceable></literal> changes the
+ recorded start value of the sequence. This has no effect on the
+ <emphasis>current</> sequence value; it simply sets the value
+ that future <command>ALTER SEQUENCE RESTART</> commands will use.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><replaceable class="parameter">restart</replaceable></term>
+ <listitem>
+ <para>
The optional clause <literal>RESTART [ WITH <replaceable
- class="parameter">start</replaceable> ]</literal> changes the
+ class="parameter">restart</replaceable> ]</literal> changes the
current value of the sequence. This is equivalent to calling the
<function>setval</> function with <literal>is_called</literal> =
<literal>false</>: the specified value will be returned by the
<emphasis>next</> call of <function>nextval</>.
Writing <literal>RESTART</> with no <replaceable
- class="parameter">start</replaceable> value is equivalent to supplying
- the start value used when the sequence was created.
+ class="parameter">restart</> value is equivalent to supplying
+ the start value that was recorded by <command>CREATE SEQUENCE</>
+ or last set by <command>ALTER SEQUENCE START WITH</>.
</para>
</listitem>
</varlistentry>
@@ -261,7 +277,8 @@ ALTER SEQUENCE serial RESTART WITH 105;
<para>
<command>ALTER SEQUENCE</command> conforms to the <acronym>SQL</acronym>
- standard, except for the <literal>OWNED BY</>, <literal>RENAME</>, and
+ standard, except for the <literal>START WITH</>,
+ <literal>OWNED BY</>, <literal>RENAME</>, and
<literal>SET SCHEMA</literal> clauses, which are
<productname>PostgreSQL</productname> extensions.
</para>