-- 获取自增列的名称
SELECT pg_get_serial_sequence('table_name', 'id') AS sequence_name;
--获取自增列的下一个值:
SELECT nextval(pg_get_serial_sequence('table_name', 'id')) AS new_id;
--设置自增列的初始值:
select setval(pg_get_serial_sequence('table_name', 'id'),100,false);
# 这个意思就是初始自增从id为100开始
标签:postgresql,name,sequence,初始值,增列,table,id
From: https://www.cnblogs.com/zonghan/p/16591276.html