1、sequence_name = schema.表名_主键_seq
每查询一次就会加 1
select nextval('dm.dm_task_task_id_seq') select nextval('dm.dm_task_task_id_seq'::regclass)
2、postgresql重置序列起始值
-- 序列重置到 1 alter sequence sequence_name restart with 1; -- 验证 SELECT nextval('sequence_name');
参考: