@@ -27,9 +27,10 @@ ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable>
2727 [ AS <replaceable class="parameter">data_type</replaceable> ]
2828 [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
2929 [ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
30+ [ [ NO ] CYCLE ]
3031 [ START [ WITH ] <replaceable class="parameter">start</replaceable> ]
3132 [ RESTART [ [ WITH ] <replaceable class="parameter">restart</replaceable> ] ]
32- [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
33+ [ CACHE <replaceable class="parameter">cache</replaceable> ]
3334 [ OWNED BY { <replaceable class="parameter">table_name</replaceable>.<replaceable class="parameter">column_name</replaceable> | NONE } ]
3435ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> SET { LOGGED | UNLOGGED }
3536ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> OWNER TO { <replaceable class="parameter">new_owner</replaceable> | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
@@ -154,6 +155,38 @@ ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> S
154155 </listitem>
155156 </varlistentry>
156157
158+ <varlistentry>
159+ <term><literal>CYCLE</literal></term>
160+ <listitem>
161+ <para>
162+ The optional <literal>CYCLE</literal> key word can be used to enable
163+ the sequence to wrap around when the
164+ <replaceable class="parameter">maxvalue</replaceable> or
165+ <replaceable class="parameter">minvalue</replaceable> has been
166+ reached by
167+ an ascending or descending sequence respectively. If the limit is
168+ reached, the next number generated will be the
169+ <replaceable class="parameter">minvalue</replaceable> or
170+ <replaceable class="parameter">maxvalue</replaceable>,
171+ respectively.
172+ </para>
173+ </listitem>
174+ </varlistentry>
175+
176+ <varlistentry>
177+ <term><literal>NO CYCLE</literal></term>
178+ <listitem>
179+ <para>
180+ If the optional <literal>NO CYCLE</literal> key word is
181+ specified, any calls to <function>nextval</function> after the
182+ sequence has reached its maximum value will return an error.
183+ If neither <literal>CYCLE</literal> or <literal>NO
184+ CYCLE</literal> are specified, the old cycle behavior will be
185+ maintained.
186+ </para>
187+ </listitem>
188+ </varlistentry>
189+
157190 <varlistentry>
158191 <term><replaceable class="parameter">start</replaceable></term>
159192 <listitem>
@@ -207,38 +240,6 @@ ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> S
207240 </listitem>
208241 </varlistentry>
209242
210- <varlistentry>
211- <term><literal>CYCLE</literal></term>
212- <listitem>
213- <para>
214- The optional <literal>CYCLE</literal> key word can be used to enable
215- the sequence to wrap around when the
216- <replaceable class="parameter">maxvalue</replaceable> or
217- <replaceable class="parameter">minvalue</replaceable> has been
218- reached by
219- an ascending or descending sequence respectively. If the limit is
220- reached, the next number generated will be the
221- <replaceable class="parameter">minvalue</replaceable> or
222- <replaceable class="parameter">maxvalue</replaceable>,
223- respectively.
224- </para>
225- </listitem>
226- </varlistentry>
227-
228- <varlistentry>
229- <term><literal>NO CYCLE</literal></term>
230- <listitem>
231- <para>
232- If the optional <literal>NO CYCLE</literal> key word is
233- specified, any calls to <function>nextval</function> after the
234- sequence has reached its maximum value will return an error.
235- If neither <literal>CYCLE</literal> or <literal>NO
236- CYCLE</literal> are specified, the old cycle behavior will be
237- maintained.
238- </para>
239- </listitem>
240- </varlistentry>
241-
242243 <varlistentry>
243244 <term><literal>SET { LOGGED | UNLOGGED }</literal></term>
244245 <listitem>
0 commit comments