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 id column on a table).
When you create a column with type serial, bigserial, or use generated 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.
Use nextval() to get the next value from a sequence:
select nextval('order_id_seq');
Use currval() to get the current value without advancing it:
select currval('order_id_seq');
What it will do -----> Enter the next value you want the sequence to use (e.g. if your data has IDs up to 999, enter 1000).
example - <img width="371" height="197" alt="Screenshot 2026-05-23 at 7 37 32 PM" src="https://github.com/user-attachments/assets/e95ac079-1230-4fa1-8629-067c5cc089cf" />
<img width="382" height="345" alt="Screenshot 2026-05-23 at 7 37 59 PM" src="https://github.com/user-attachments/assets/9fb8109e-6c14-4108-ab06-d3d85636a1c1" />Vinay Sohaliya is seeking guidance on how to reset a sequence in a database. The user provides an explanation of sequences, their use in generating unique integers for primary keys, and examples of SQL commands like nextval() and currval(). The user includes screenshots to illustrate the process.