Vikrant Rathore <vikrant@chemquick.com> writes:
> select date_part('epoch','12 hours'::timespan)::float4;
> ERROR: function dtof(float8) does not exist
What Postgres version are you using? The above query appears to work
fine in both 6.4.2 and 6.5. I'm guessing you are getting bit by some
bug in an older release ...
If you don't want to update, you might also try the variant forms
select float4(date_part('epoch','12 hours'::timespan));
select date_part('epoch','12 hours'::timespan) AS float4;
regards, tom lane