Last active
March 27, 2018 22:37
-
-
Save vandro/33fb486139e0b2ee32128aa7da6d9ced to your computer and use it in GitHub Desktop.
Reset primary key POSTGRESQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER SEQUENCE <TABLE_NAME>_id_seq RESTART; | |
TRUNCATE <TABLE_NAME> RESTART IDENTITY; | |
--UPDATE <TABLE_NAME> SET id=nextval('seq'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment