Created
April 2, 2021 14:13
-
-
Save dexalex84/7dd66c5ed2de915742dee8d5d1fa285e to your computer and use it in GitHub Desktop.
Postgres sequence
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
select pg_get_serial_sequence('lookup.state','id') -- get seq for table and id | |
select currval('lookup.state_id_seq'); -- current value | |
select nextval('lookup.state_id_seq'); -- next value | |
--restart value | |
ALTER SEQUENCE lookup.state_id_seq RESTART WITH 563; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment