使用语句: select setval('your_table_id_seq',(select max(id) from 表名));如何查看 your_table_id_seq?使用命令:\d 表名
select setval('your_table_id_seq',(select max(id) from 表名));
your_table_id_seq
\d 表名
得出以下结果,看图中红色方框圈住的: