Skip to content

Instantly share code, notes, and snippets.

@tonioriol
Created March 8, 2018 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonioriol/0631950e078cab7b5bf772698dca1267 to your computer and use it in GitHub Desktop.
Save tonioriol/0631950e078cab7b5bf772698dca1267 to your computer and use it in GitHub Desktop.
Reset Postgres Autoincrement
select setval((select pg_get_serial_sequence('table_name', 'id')), (select max(id) from table_name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment