I want to do an insert on the following table but I am not able to convert an ARRAY of dates.
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,
)
The INSERT
I am trying to perform:
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
I get the following error:
ERROR: Column 'date' is of type date But the expression is of type integer