postgresql reset auto increment
-- if you dont mind losing the data, do the following
TRUNCATE TABLE someTable RESTART IDENTITY;
postgresql reset auto increment
-- if you dont mind losing the data, do the following
TRUNCATE TABLE someTable RESTART IDENTITY;
postgresql reset auto_increment index
-- Change the starting value of the sequence
ALTER SEQUENCE project_id_seq RESTART 3000;
-- Same but dynamic :
SELECT SETVAL('project_id_seq', (SELECT MAX(id) + 1 FROM project));
postgresql update auto_increment value
ALTER SEQUENCE product_id_seq RESTART WITH 1453
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us