postgre设置自增列
先创建一个序列:
CREATE SEQUENCE t_Camera_IntId_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
t_Camera表面,intid列明
修改列默认值为序列:
ALTER TABLE "t_Camera" ALTER COLUMN "IntId" SET DEFAULT nextval( 't_Camera_IntId_seq' );
先创建一个序列:
CREATE SEQUENCE t_Camera_IntId_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
t_Camera表面,intid列明
修改列默认值为序列:
ALTER TABLE "t_Camera" ALTER COLUMN "IntId" SET DEFAULT nextval( 't_Camera_IntId_seq' );