create table if not exists device ( id serial not null constraint device_pk primary key, name varchar(256) not null, type varchar(128) not null, specification varchar(256), date_produced date, date_install date, date_guarantee date, date_mainten date ); comment on column device.specification is '规格 '; comment on column device.date_produced is '生产日期'; comment on column device.date_install is '安装日期'; comment on column device.date_guarantee is '质保期'; comment on column device.date_mainten is '维保期'; create unique index if not exists device_id_uindex on device (id);