Resetting a sequence #46296
Unanswered
Vinaysohaliya
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A sequence is a database object that generates a series of unique integers. Sequences are most commonly used to produce primary key values automatically (e.g. the
idcolumn on a table).When you create a column with type
serial,bigserial, or usegenerated always as identity, Postgres automatically creates and manages a sequence for that column. These sequences appear on the Sequences page and can be reset the same way.Using a sequence
Use
nextval()to get the next value from a sequence:Use
currval()to get the current value without advancing it:What it will do -----> Enter the next value you want the sequence to use (e.g. if your data has IDs up to
999, enter1000).example -

Beta Was this translation helpful? Give feedback.
All reactions