SELECT MAX(id) FROM your_table;
SELECT nextval('your_table_id_seq');
SELECT setval('your_table_id_seq', (SELECT MAX(id) FROM your_table));
Last active
August 14, 2018 21:33
-
-
Save mobilestack/8789844 to your computer and use it in GitHub Desktop.
postgresql id_seq reset
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment