SELECT setval('your_sequence_name', (SELECT max(id) FROM your_table));
Created
May 23, 2018 15:40
-
-
Save ralexx/40c914c765de447ba93e04cb399447f5 to your computer and use it in GitHub Desktop.
Resetting Postgres integer primary key counter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment