1、sequence_name = schema.表名_主键_seq

postgresql 的序列 serial

 

  每查询一次就会加 1

select nextval('dm.dm_task_task_id_seq')
select nextval('dm.dm_task_task_id_seq'::regclass)

postgresql 的序列 serial

 

2、postgresql重置序列起始值

-- 序列重置到 1
alter sequence sequence_name restart with 1;

-- 验证
SELECT nextval('sequence_name');

 

参考:

  1)https://www.cnblogs.com/alianbog/p/5654604.html

相关文章:

  • 2021-11-21
  • 2021-05-19
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-12-09
  • 2021-12-03
  • 2021-06-29
猜你喜欢
  • 2022-01-30
  • 2022-12-23
  • 2021-11-11
  • 2022-01-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案