AK
Size: a a a
AK
AN
Ð

YS
AK
DM
2_
DM
GR
IS
JSONB объекта.event_shows выглядит как: [{"times":[{"end":"13:00","start":"12:00"}],"endDate":"2020-05-19T19:45:47.121Z","startDate":"2020-05-19T19:45:47.121Z"},{"startDate":"2020-05-20T19:55:15.000Z","endDate":"2020-05-20T19:55:15.000Z","times":[{"start":"12:00","end":"13:00"}]}]...
FOR showing IN SELECT * FROM json_to_recordset(to_json(event_times)) AS show(id INTEGER,
times JSONB, startDate DATE, endDate DATE) LOOP
IF showing.id > 0 THEN
UPDATE
event_shows
SET
start_date = showing.startDate, end_date = showing.endDate, times = showing.times
WHERE
event_id = eid AND
id = showing.id;
ELSE
INSERT INTO
event_shows (event_id, start_date, end_date, times)
VALUES
(eid, showing.startDate, showing.endDate, showing.times);
END IF;
END LOOP;
...
CREATE TABLE event_shows (
id SERIAL,
event_id SERIAL NOT NULL REFERENCES event(id),
start_date DATE NOT NULL,
end_date DATE NOT NULL,
times JSONB,
PRIMARY KEY (id)
);
null value in column \"start_date\" violates not-null constraint. на INSERT INTO
event_shows (event_id, start_date, end_date, times)
VALUES
(eid, showing.startDate, showing.endDate, showing.times);
showing.startDate и showing.endDate на константу, например "2020-05-19T19:45:47.121Z", INSERT работает.2_
2_
DG
AK
function st_bandmetadata(public.raster, integer[]) does not exist
No function matches the given name and argument types. You might need to add explicit type casts.
2_
2_
GR
EB

2_