ALTER SEQUENCE — change the definition of a sequence generator
ALTER SEQUENCE [ IF EXISTS ]name[ ASdata_type] [ INCREMENT [ BY ]increment] [ MINVALUEminvalue| NO MINVALUE ] [ MAXVALUEmaxvalue| NO MAXVALUE ] [ RESTART [ [ WITH ]restart] ] [ CACHEcache] [ [ NO ] CYCLE ] [ OWNED BY {table_name.column_name| NONE } ] ALTER SEQUENCE [ IF EXISTS ]nameOWNER TO {new_owner| CURRENT_ROLE | CURRENT_USER | SESSION_USER } ALTER SEQUENCE [ IF EXISTS ]nameRENAME TOnew_nameALTER SEQUENCE [ IF EXISTS ]nameSET SCHEMAnew_schema
ALTER SEQUENCE changes the parameters of an
existing sequence generator. The extended forms of ALTER
SEQUENCE are mostly the same as in
PostgreSQL (see
ALTER SEQUENCE)
except for the following differences:
The minimum sequence value parameter in Shardman works more like a lower boundary on the global interval of available values, so it can only be increased to make sure no duplicate numbers are generated.
The RESTART WITH clause allows
restarting a sequence at any arbitrary lower bound, but
in this case, there is no guarantee that previously
generated numbers will not repeat.
Using both RESTART WITH and
MINVALUE in a single statement is
not permitted to avoid confusion.
Alter the block size parameter of a sequence called
serial:
ALTER SEQUENCE serial SET (block_size = 8192);