设置自增长序列号
CREATE SEQUENCE employee_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
关联表
alter table employee alter column id set default nextval(‘employee_id_seq’);
查询当前序列号
SELECT nextval(‘employee_id_seq’);
改变序列号初始值
alter sequence employee_id_seq restart with 1000