pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: vikrant@chemquick.com
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Mail about typecast
Date: Tue, 15 Jun 1999 09:39:56 -0400
Message-ID: <22557.929453996@sss.pgh.pa.us> (raw)
In-Reply-To: <3765C5B3.C05DC56D@chemquick.com>

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



view thread (6+ messages)  latest in thread

Message-ID: <22557.929453996@sss.pgh.pa.us>
Permalink:  ../22557.929453996@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22557.929453996@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vikrant@chemquick.com
  Subject: Re: [SQL] Mail about typecast
  In-Reply-To: <22557.929453996@sss.pgh.pa.us>
  References: <3765C5B3.C05DC56D@chemquick.com> <22557.929453996@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox