Answers for "how to clear vales of auto increment postgresql and start from the beginning"

SQL
0

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));
Posted by: Guest on September-10-2020
1

postgresql update auto_increment value

ALTER SEQUENCE product_id_seq RESTART WITH 1453
Posted by: Guest on March-20-2020

Code answers related to "how to clear vales of auto increment postgresql and start from the beginning"

Code answers related to "SQL"

Browse Popular Code Answers by Language