Возвращаю строку
if (f.entered > tss2 and f.ended <= tse2 and tss != f.ended and f.ended > tss)
then
tseb = (f.ended + f.duration * interval '1 second')::timestamp(0);
RETURN NEXT ( f.ended , tseb,
r.login,
r.status,
r.reason,
r.duration,
r.t_dur
);
end if;
получаю
ERROR: returned record type does not match expected record type DETAIL: Returned type timestamp without time zone does not match expected type timestamp(6) without time zone in column 2. CONTEXT: PL/pgSQL function get_all_foo2(timestamp without time zone,timestamp without time zone) line 47 at RETURN NEXT
при этом ended - timestamp, duration - integer
не могу понять как привести к валидному типу
композитный тип
CREATE TYPE public.composite_type AS (
ended TIMESTAMP(0) WITHOUT TIME ZONE,
entered TIMESTAMP(0) WITHOUT TIME ZONE,
login VARCHAR(100),
status VARCHAR(100),
reason VARCHAR(100),
duration INTEGER,
t_dur TIME(0) WITHOUT TIME ZONE
);
tseb = to_timestamp(f.ended + f.duration * interval '1 second', 'YYYY-MM-DD HH24:MI:SS')::timestamp without time zone;
тоже не проходит
HINT: No function matches the given name and argument types. You might need to add explicit type casts. QUERY: SELECT to_timestamp(f.ended + f.duration * interval '1 second', 'YYYY-MM-DD HH24:MI:SS')::timestamp without time zone CONTEXT: PL/pgSQL function get_all_foo2(timestamp without time zone,timestamp without time zone) line 45 at assignment
а значение валидное 2016-05-21 12:17:00