diff options
Diffstat (limited to 'doc/src/sgml/ref/create_sequence.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_sequence.sgml | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/doc/src/sgml/ref/create_sequence.sgml b/doc/src/sgml/ref/create_sequence.sgml index 2af8c8d23e3..9248b1d459a 100644 --- a/doc/src/sgml/ref/create_sequence.sgml +++ b/doc/src/sgml/ref/create_sequence.sgml @@ -67,10 +67,10 @@ SELECT * FROM <replaceable>name</replaceable>; </programlisting> to examine the parameters and current state of a sequence. In particular, - the <literal>last_value</> field of the sequence shows the last value + the <literal>last_value</literal> field of the sequence shows the last value allocated by any session. (Of course, this value might be obsolete by the time it's printed, if other sessions are actively doing - <function>nextval</> calls.) + <function>nextval</function> calls.) </para> </refsect1> @@ -250,14 +250,14 @@ SELECT * FROM <replaceable>name</replaceable>; </para> <para> - Sequences are based on <type>bigint</> arithmetic, so the range + Sequences are based on <type>bigint</type> arithmetic, so the range cannot exceed the range of an eight-byte integer (-9223372036854775808 to 9223372036854775807). </para> <para> - Because <function>nextval</> and <function>setval</> calls are never - rolled back, sequence objects cannot be used if <quote>gapless</> + Because <function>nextval</function> and <function>setval</function> calls are never + rolled back, sequence objects cannot be used if <quote>gapless</quote> assignment of sequence numbers is needed. It is possible to build gapless assignment by using exclusive locking of a table containing a counter; but this solution is much more expensive than sequence @@ -271,9 +271,9 @@ SELECT * FROM <replaceable>name</replaceable>; used for a sequence object that will be used concurrently by multiple sessions. Each session will allocate and cache successive sequence values during one access to the sequence object and - increase the sequence object's <literal>last_value</> accordingly. + increase the sequence object's <literal>last_value</literal> accordingly. Then, the next <replaceable class="parameter">cache</replaceable>-1 - uses of <function>nextval</> within that session simply return the + uses of <function>nextval</function> within that session simply return the preallocated values without touching the sequence object. So, any numbers allocated but not used within a session will be lost when that session ends, resulting in <quote>holes</quote> in the @@ -290,18 +290,18 @@ SELECT * FROM <replaceable>name</replaceable>; 11..20 and return <function>nextval</function>=11 before session A has generated <literal>nextval</literal>=2. Thus, with a <replaceable class="parameter">cache</replaceable> setting of one - it is safe to assume that <function>nextval</> values are generated + it is safe to assume that <function>nextval</function> values are generated sequentially; with a <replaceable class="parameter">cache</replaceable> setting greater than one you - should only assume that the <function>nextval</> values are all + should only assume that the <function>nextval</function> values are all distinct, not that they are generated purely sequentially. Also, - <literal>last_value</> will reflect the latest value reserved by + <literal>last_value</literal> will reflect the latest value reserved by any session, whether or not it has yet been returned by - <function>nextval</>. + <function>nextval</function>. </para> <para> - Another consideration is that a <function>setval</> executed on + Another consideration is that a <function>setval</function> executed on such a sequence will not be noticed by other sessions until they have used up any preallocated values they have cached. </para> @@ -365,14 +365,14 @@ END; <itemizedlist> <listitem> <para> - Obtaining the next value is done using the <function>nextval()</> + Obtaining the next value is done using the <function>nextval()</function> function instead of the standard's <command>NEXT VALUE FOR</command> expression. </para> </listitem> <listitem> <para> - The <literal>OWNED BY</> clause is a <productname>PostgreSQL</> + The <literal>OWNED BY</literal> clause is a <productname>PostgreSQL</productname> extension. </para> </listitem> |