![]() This is similar to calling the setval function with is_called = false: the specified value will be returned by the next call of nextval. The optional clause RESTART changes the current value of the sequence. This has no effect on the current sequence value it simply sets the value that future ALTER SEQUENCE RESTART commands will use. The optional clause START WITH start changes the recorded start value of the sequence. If neither option is specified, the current maximum value will be maintained. If NO MAXVALUE is specified, the defaults of the maximum value of the data type and -1 for ascending and descending sequences, respectively, will be used. The optional clause MAXVALUE maxvalue determines the maximum value for the sequence. If neither option is specified, the current minimum value will be maintained. If NO MINVALUE is specified, the defaults of 1 and the minimum value of the data type for ascending and descending sequences, respectively, will be used. The optional clause MINVALUE minvalue determines the minimum value a sequence can generate. If unspecified, the old increment value will be maintained. ![]() ![]() A positive value will make an ascending sequence, a negative one a descending sequence. The clause INCREMENT BY increment is optional. If the minimum and maximum values do not fit into the new data type, an error will be generated. Otherwise, the minimum and maximum values are preserved, unless new values are given as part of the same command. Valid types are smallint, integer, and bigint.Ĭhanging the data type automatically changes the minimum and maximum values of the sequence if and only if the previous minimum and maximum values were the minimum or maximum value of the old data type (in other words, if the sequence had been created using NO MINVALUE or NO MAXVALUE, implicitly or explicitly). The optional clause AS data_type changes the data type of the sequence. IF EXISTSĭo not throw an error if the sequence does not exist. The name (optionally schema-qualified) of a sequence to be altered.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |