Skip to content

Instantly share code, notes, and snippets.

@arsham
Created March 6, 2015 09:09
Show Gist options
  • Save arsham/2473f6713bd441859b74 to your computer and use it in GitHub Desktop.
Save arsham/2473f6713bd441859b74 to your computer and use it in GitHub Desktop.
Updates the incremental value of the PK.
SELECT setval('TEABLE_NAME_id_seq', (SELECT MAX(id) FROM TEABLE_NAME));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment