Re: [SQL] Mail about typecast - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] Mail about typecast
Date
Msg-id 22557.929453996@sss.pgh.pa.us
Whole thread Raw
In response to Mail about typecast  (Vikrant Rathore <vikrant@chemquick.com>)
Responses Re: [SQL] Mail about typecast
List pgsql-sql
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


pgsql-sql by date:

Previous
From: José Soares
Date:
Subject: Re: [SQL] Mail about typecast
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] Mail about typecast