Re: [SQL] Mail about typecast

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: vikrant(at)chemquick(dot)com, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Mail about typecast
Date: 1999-06-15 14:07:17
Message-ID: 22648.929455637@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il> writes:
> At 16:39 +0300 on 15/06/1999, Tom Lane wrote:
>> select date_part('epoch','12 hours'::timespan) AS float4;

> Probably missing a CAST keyword here, isn't it?

My mistake, this should have been

select CAST (date_part('epoch','12 hours'::timespan) AS float4);

(the parens are required too). The first way just relabels the
output column, it doesn't actually change the datatype :-(

regards, tom lane

Browse pgsql-sql by date

  From Date Subject
Next Message Arendt, Volker 1999-06-15 14:30:54 subscribe pgsql-sql
Previous Message Herouth Maoz 1999-06-15 13:52:41 Re: [SQL] Mail about typecast