If you created the table product
with an id
column, then the sequence is not simply called product
, but rather product_id_seq
(that is, ${table}_${column}_seq
).
This is the ALTER SEQUENCE
command you need:
ALTER SEQUENCE product_id_seq RESTART WITH 1453
You can see the sequences in your database using the ds
command in psql. If you do d product
and look at the default constraint for your column, the nextval(...)
call will specify the sequence name too.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…