Create a new sequence - postgres docs
Arguments:
sequence_name[string] - name of the new sequenceoptions[object] - options:temporary[boolean] - addsTEMPORARYclauseifNotExists[boolean] - addsIF NOT EXISTSclausetype[string] - type of the sequenceincrement[number] - sets first value of sequenceminvalue[number or boolean] - sets minimum value of sequence orNO MINVALUE(on false or null value)maxvalue[number or boolean] - sets maximum value of sequencee orNO MAXVALUE(on false or null value)start[number] - sets first value of sequencecache[number] - sets how many sequence numbers should be preallocatedcycle[boolean] - addsCYCLEorNO CYCLEclause if option is presentowner[string or boolean] - sets owner of sequence or no owner (on false or null value)
Reverse Operation: dropSequence
Drop a sequence - postgres docs
Arguments:
sequence_name[string] - name of the the sequence to dropdrop_options[object] - options:ifExists[boolean] - drops sequence only if it existscascade[boolean] - drops also dependent objects
Alter a sequence - postgres docs
Arguments:
sequence_name[string] - name of the new sequenceoptions[object] - options:type[string] - type of the sequenceincrement[number] - sets first value of sequenceminvalue[number or boolean] - sets minimum value of sequence orNO MINVALUE(on false or null value)maxvalue[number or boolean] - sets maximum value of sequencee orNO MAXVALUE(on false or null value)start[number] - sets first value of sequence (no effect until restart)restart[number or boolean] - sets first value of sequence or usingstartvalue (on true value)cache[number] - sets how many sequence numbers should be preallocatedcycle[boolean] - addsCYCLEorNO CYCLEclause if option is presentowner[string or boolean] - sets owner of sequence or no owner (on false or null value)
Rename a sequence - postgres docs
Arguments:
old_sequence_name[string] - old name of the sequencenew_sequence_name[string] - new name of the sequence