ALTER SEQUENCE mytable_id_seq RESTART WITH 1
If at the same time resetting a autoincrement field in postgresql we also want to empty the table, you can run this command:
TRUNCATE TABLE mytable RESTART IDENTITY;
ALTER SEQUENCE mytable_id_seq RESTART WITH 1
If at the same time resetting a autoincrement field in postgresql we also want to empty the table, you can run this command:
TRUNCATE TABLE mytable RESTART IDENTITY;