简单的两个方法,个人比较喜欢第一个
①ALTER SEQUENCE seq RESTART WITH 1;②
①ALTER SEQUENCE seq RESTART WITH 1;
SELECT setval('sequence_name', 0);参考自http://stackoverflow.com/questions/4678110/how-to-reset-sequence-in-postgres-and-fill-id-column-with-new-data