I return a string
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;
getting
If you’re not a match, you’ll have the correct type of timestamp. It will not be a match. 2. CONTEXT: PL / pgSQL function get_all_foo2 (timestamp without time zone, time zone) line 47 at RETURN NEXT
at the same time ended - timestamp, duration - integer
I can not understand how to lead to a valid type
composite type
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;
also does not pass
HINT: No function matches. 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
and the value is valid 2016-05-21 12:17:00