summaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/alter_sequence.sgml
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-10-25 18:54:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-10-25 18:54:03 +0000
commit9ddfe034c7d7ee9c4a7dcae1ba37e5e4e5ac2488 (patch)
treee90ebbb67d541d434072a402b816de3632f02be1 /doc/src/sgml/ref/alter_sequence.sgml
parentdbe48765cd5697349ac00bd3e81cf45c8e0ddb1f (diff)
downloadpostgresql-9ddfe034c7d7ee9c4a7dcae1ba37e5e4e5ac2488.tar.gz
Fix ALTER SEQUENCE so that it does not affect the value of currval() for
the sequence. Also, make setval() with is_called = false not affect the currval state, either. Per report from Kris Jurka that an implicit ALTER SEQUENCE OWNED BY unexpectedly caused currval() to become valid. Since this isn't 100% backwards compatible, it will go into HEAD only; I'll put a more limited patch into 8.2.
Diffstat (limited to 'doc/src/sgml/ref/alter_sequence.sgml')
-rw-r--r--doc/src/sgml/ref/alter_sequence.sgml13
1 files changed, 11 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/alter_sequence.sgml b/doc/src/sgml/ref/alter_sequence.sgml
index b515ae4601..3c982eee6f 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.18 2007/10/03 16:48:43 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_sequence.sgml,v 1.19 2007/10/25 18:54:03 tgl Exp $
PostgreSQL documentation
-->
@@ -114,7 +114,10 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
<para>
The optional clause <literal>RESTART WITH <replaceable
class="parameter">start</replaceable></literal> changes the
- current value of the sequence.
+ 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</>.
</para>
</listitem>
</varlistentry>
@@ -227,6 +230,12 @@ ALTER SEQUENCE <replaceable class="parameter">name</replaceable> SET SCHEMA <rep
</para>
<para>
+ <command>ALTER SEQUENCE</command> does not affect the <function>currval</>
+ status for the sequence. (Before <productname>PostgreSQL</productname>
+ 8.3, it sometimes did.)
+ </para>
+
+ <para>
Some variants of <command>ALTER TABLE</command> can be used with
sequences as well; for example, to rename a sequence it is also
possible to use <command>ALTER TABLE RENAME</command>.