1.创建表
2.创建主键约束,确定主键
3.新建序列 设置序列起始值与增量
CREATE SEQUENCE table_seq START WITH 1 INCREMENT BY 1;
4.执行sql
alter table "表名" alter column "主键名" set default nextval('table_seq')
CREATE SEQUENCE table_seq START WITH 1 INCREMENT BY 1;
alter table "表名" alter column "主键名" set default nextval('table_seq')