Skip to content

Instantly share code, notes, and snippets.

@vandro
Last active March 27, 2018 22:37
Show Gist options
  • Save vandro/33fb486139e0b2ee32128aa7da6d9ced to your computer and use it in GitHub Desktop.
Save vandro/33fb486139e0b2ee32128aa7da6d9ced to your computer and use it in GitHub Desktop.
Reset primary key POSTGRESQL
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