我想在下表中插入,但我无法转换日期数组。
CREATE TABLE schedule (
idschedule serial NOT NULL,
idzone integer NOT NULL,
"time" timestamp without time zone NOT NULL,
automatic boolean NOT NULL,
idrecurrence character varying(20),
duration integer,
date date,
)
Run Code Online (Sandbox Code Playgroud)
在INSERT我试图执行:
INSERT INTO schedule(idzone, "date", "time", duration, automatic)
SELECT x, y, '20:00:00', '20', 'FALSE'
FROM unnest(ARRAY[3,4,5]) x
, unnest(ARRAY[2015-4-12, 2015-4-19, 2015-4-26]) y
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
错误:列“日期”的类型为日期但表达式的类型为整数