方法1:自增起始数设置成1
select setval(‘your_table_id_seq’,1);
方法2:把当前最大的id做为当前的id自增起始数
#使用语句:
select setval(‘your_table_id_seq’,(select max(id) from 表名));
#如何查看your_table_id_seq
postgresql 修改id的自增起始数
最新推荐文章于 2024-12-30 08:59:21 发布
方法1:自增起始数设置成1
select setval(‘your_table_id_seq’,1);
方法2:把当前最大的id做为当前的id自增起始数
#使用语句:
select setval(‘your_table_id_seq’,(select max(id) from 表名));
#如何查看your_table_id_seq