I launched a webapp that uses JPA/Hibernate with a Postgres DB. I want to increase the lower bound for generated keys, so the site doesn’t look so “new.”
How can I do this with hibernate and/or postgres? I know in MySQL you can set the starting value for AUTO_INCREMENT, and I’m looking for a similar feature. Any solution is fine, whether its a hibernate config ( I’m using annotations ) or a one time thing I can diddle in the DB to make future keys start higher.
Thanks!
I assume you are using sequences in postgresql.
You have to go through every of them and set the next value to be higher:
ALTER SEQUENCE serial RESTART WITH 105;105is the new id.