-- Table: public.iots_product
-- DROP TABLE public.iots_product;
CREATE TABLE public.iots_product
(
pid integer NOT NULL DEFAULT nextval('iots_product_pid_seq'::regclass), -- 产品id
uid integer NOT NULL, -- 用户id
did integer[], --设备id
func_page integer[], -- 内容id
name character varying(200) NOT NULL,
key character varying(200),
config jsonb NOT NULL DEFAULT '{"iots": "iots"}'::jsonb,
desc
created_at timestamp without time zone,
updated_at timestamp without time zone,
CONSTRAINT ppid PRIMARY KEY (pid)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.iots_product
OWNER TO postgres;
COMMENT ON TABLE public.iots_product
IS '产品表';
COMMENT ON COLUMN public.iots_product.pid IS '产品id';
COMMENT ON COLUMN public.iots_product.uid IS '用户id';
COMMENT ON COLUMN public.iots_product.did IS '设备id';
COMMENT ON COLUMN public.iots_product.func_page IS '内容id';
-------------------------------------------------------------------------------------------
其中设备id和内容id是两个数组,如何向这两个数组中添加数据?
最佳答案