I have this Sequence defined in sqlalchemy for postgres
import sqlalchemy as sa
user_id_sequence = sa.Sequence(name='user_id_seq',
start=100000,
increment=10,
maxvalue=100000000,
cache=100)
For some business logic I can't have a sequence of numbers with an increment of 1. What I want to do is after we reach maxvalue
the sequence starts over again but now with start
parameters as 100001. In this way the sequence will not collide with other already generated numbers and also I can re use the sequence without worrying about running out of numbers.
Is this possible?