I am trying to change minimum value of an existing sequence.
First I tried
ALTER SEQUENCE product_id_seq MINVALUE 10000;
and I got ERROR: START value (1) cannot be less than MINVALUE (10000).
So I tried
ALTER SEQUENCE product_id_seq MINVALUE 10000 RESTART WITH 10000;
but got the same error.
Of course I could just drop it and create a new one, but I think there should be a way to do this. I am using Postgres 8.4.7.
How about setting them all at once:
ALTER SEQUENCE product_id_seq
MINVALUE 10000
START 10000
RESTART 10000;
That should change the minimum, starting, and current values all to 10000 and thus make everything consistent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With