@@ -27,9 +27,10 @@ ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable>
27
27
[ AS <replaceable class="parameter">data_type</replaceable> ]
28
28
[ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
29
29
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
30
+ [ [ NO ] CYCLE ]
30
31
[ START [ WITH ] <replaceable class="parameter">start</replaceable> ]
31
32
[ RESTART [ [ WITH ] <replaceable class="parameter">restart</replaceable> ] ]
32
- [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
33
+ [ CACHE <replaceable class="parameter">cache</replaceable> ]
33
34
[ OWNED BY { <replaceable class="parameter">table_name</replaceable>.<replaceable class="parameter">column_name</replaceable> | NONE } ]
34
35
ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> SET { LOGGED | UNLOGGED }
35
36
ALTER 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
154
155
</listitem>
155
156
</varlistentry>
156
157
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
+
157
190
<varlistentry>
158
191
<term><replaceable class="parameter">start</replaceable></term>
159
192
<listitem>
@@ -207,38 +240,6 @@ ALTER SEQUENCE [ IF EXISTS ] <replaceable class="parameter">name</replaceable> S
207
240
</listitem>
208
241
</varlistentry>
209
242
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
-
242
243
<varlistentry>
243
244
<term><literal>SET { LOGGED | UNLOGGED }</literal></term>
244
245
<listitem>
0 commit comments