Question : postgresql reset sequence
Answered by : outrageous-oyster-a1m9wtagrqcj
ALTER SEQUENCE <tablename>_<id>_seq RESTART WITH 1
Source : https://stackoverflow.com/questions/4678110/how-to-reset-sequence-in-postgres-and-fill-id-column-with-new-data | Last Update : Tue, 06 Apr 21
Question : reset id sequence postgres
Answered by : shy-skipper-qiy4c6pcndj0
alter sequence <tableName>_id_seq restart with 1;
For an instance, we have a table named "groups" and we need to reset the id sequence with 1.
alter sequence groups_id_seq restart with 1;
Source : | Last Update : Mon, 13 Jul 20