I would like to make a script in PostgreSQL to create a sequence for a table. I would like to put maximum value of another sequence as a min value of this new one. I'm trying to do this like:
create sequence test
INCREMENT 1
MINVALUE SELECT max (id) from test_table
Also I've tried:
create sequence test
INCREMENT 1
MINVALUE SELECT nextval('old_seq')
Is it even possible to do this at the point of creation?