From: | Oxeye <oxeye(at)optonline(dot)net> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Plpgsql Question |
Date: | 2002-03-29 16:35:25 |
Message-ID: | 003301c1d73f$bac32ff0$05a8a8c0@oxeye |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hello,
I'm new to Postgresql and plpgslq. I wrote a plpgsql to return epoch time
from a table, but had problem running it. The error returned:
NOTICE: Error occurred while executing PL/pgSQL function sleeptime
NOTICE: line 10 at assignment
ERROR: Bad timestamp external representation 'rec_runtime.runtime'
My plpgsql function:
create function sleeptime () returns float as '
declare
rec_runtime record;
ret_sleepsecs float;
begin
select into rec_runtime runtime from mon_nextrun order by runtime
limit 1;
if rec_runtime.runtime is null
then
return 60;
end if;
ret_sleepsecs := extract (epoch from timestamp
''rec_runtime.runtime'') as float;
return ret_sleepsecs;
end;
' language 'plpgsql';
What is the correct syntax for extract function in the assignment statement?
Thanks in advance.
-CT
From | Date | Subject | |
---|---|---|---|
Next Message | Steve Wolfe | 2002-03-29 17:48:40 | Re: Performance Tuning Document? |
Previous Message | Marin Dimitrov | 2002-03-29 16:16:27 | Re: Performance Tuning Document? |