Created
March 10, 2020 12:50
-
-
Save takakd/736d32ba0e1f5241032a4c9495bac512 to your computer and use it in GitHub Desktop.
Update sequence by last_value in PostgreSQL
This file contains 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
-- update sequence by last_value | |
SELECT setval('some_table_seq', (SELECT last_value FROM some_table_seq)+1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment