SELECT setval('the_primary_key_sequence', (SELECT MAX(the_primary_key) FROM the_table)+1);
# Reset the counter of a table named yourTable to start at id # 1453 ALTER SEQUENCE yourTable_id_seq RESTART WITH 1453