如何将数据插入到postgresql的数组类型中?

浏览:2561 发布日期:2016/06/25 分类:求助交流 关键字: postgresql 数组
产品表---
-- 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,
description text,
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是两个数组,如何向这两个数组中添加数据?

最佳答案
评论( 相关
后面还有条评论,点击查看>>