创建序列
create sequence seq_user_camera_version increment by 1 minvalue 1 no maxvalue start with 1;
建表,并用上面的序列作为主键自增序列
CREATE TABLE public.user_camera_version (
id int4 NOT NULL DEFAULT nextval('seq_user_camera_version'::regclass),
user_id int4 NULL,
user_type varchar(1) NULL,
hardware_version varchar(100) NULL,
software_version varchar(100) NULL,
modify_date timestamp NULL,
CONSTRAINT user_camera_version_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
) ;
查询序列
select nextval('seq_user_camera_version');
删除序列:
DROP SEQUENCE IF EXISTS seq_user_camera_version;