Re: CAST and timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: KeithW(at)NarrowPathInc(dot)com
Cc: PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: CAST and timestamp
Date: 2004-12-21 04:02:37
Message-ID: 2331.1103601757@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Keith Worthington <KeithW(at)NarrowPathInc(dot)com> writes:
> Tom Lane wrote:
>> Try casting the inputs to type "text" and then to timestamp or real.

> Are you saying that I should try something like
> CAST( CAST( quantity AS text ) AS float4) AS quantity

Right. (In the cases where you were concatenating, do that inside the
first cast.)

BTW, Postgres hackers would tend to write the above as

quantity::text::float4

which is not SQL-spec notation but sure saves a lot of typing.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mike G 2004-12-21 04:08:17 Re: CAST and timestamp
Previous Message Keith Worthington 2004-12-21 03:48:43 Re: CAST and timestamp