@@ -9741,6 +9741,27 @@ nextval('foo'::text) <lineannotation><literal>foo</literal> is looked up at
9741
9741
execute <function>nextval</function> concurrently, each will safely receive
9742
9742
a distinct sequence value.
9743
9743
</para>
9744
+
9745
+ <para>
9746
+ If a sequence object has been created with default parameters,
9747
+ successive <function>nextval</function> calls will return successive
9748
+ values beginning with 1. Other behaviors can be obtained by using
9749
+ special parameters in the <xref linkend="sql-createsequence"> command;
9750
+ see its command reference page for more information.
9751
+ </para>
9752
+
9753
+ <important>
9754
+ <para>
9755
+ To avoid blocking concurrent transactions that obtain numbers from the
9756
+ same sequence, a <function>nextval</function> operation is never
9757
+ rolled back; that is, once a value has been fetched it is considered
9758
+ used, even if the transaction that did the
9759
+ <function>nextval</function> later aborts. This means that aborted
9760
+ transactions might leave unused <quote>holes</quote> in the sequence
9761
+ of assigned values.
9762
+ </para>
9763
+ </important>
9764
+
9744
9765
</listitem>
9745
9766
</varlistentry>
9746
9767
@@ -9804,31 +9825,18 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi
9804
9825
The result returned by <function>setval</function> is just the value of its
9805
9826
second argument.
9806
9827
</para>
9828
+ <important>
9829
+ <para>
9830
+ Because sequences are non-transactional, changes made by
9831
+ <function>setval</function> are not undone if the transaction rolls
9832
+ back.
9833
+ </para>
9834
+ </important>
9807
9835
</listitem>
9808
9836
</varlistentry>
9809
9837
</variablelist>
9810
9838
</para>
9811
9839
9812
- <para>
9813
- If a sequence object has been created with default parameters,
9814
- successive <function>nextval</function> calls will return successive values
9815
- beginning with 1. Other behaviors can be obtained by using
9816
- special parameters in the <xref linkend="sql-createsequence"> command;
9817
- see its command reference page for more information.
9818
- </para>
9819
-
9820
- <important>
9821
- <para>
9822
- To avoid blocking concurrent transactions that obtain numbers from the
9823
- same sequence, a <function>nextval</function> operation is never rolled back;
9824
- that is, once a value has been fetched it is considered used, even if the
9825
- transaction that did the <function>nextval</function> later aborts. This means
9826
- that aborted transactions might leave unused <quote>holes</quote> in the
9827
- sequence of assigned values. <function>setval</function> operations are never
9828
- rolled back, either.
9829
- </para>
9830
- </important>
9831
-
9832
9840
</sect1>
9833
9841
9834
9842