Re: CAST and timestamp - Mailing list pgsql-novice

From Tom Lane
Subject Re: CAST and timestamp
Date
Msg-id 2331.1103601757@sss.pgh.pa.us
Whole thread Raw
In response to Re: CAST and timestamp  (Keith Worthington <KeithW@NarrowPathInc.com>)
Responses Re: CAST and timestamp  ("Keith Worthington" <keithw@narrowpathinc.com>)
List pgsql-novice
Keith Worthington <KeithW@NarrowPathInc.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

pgsql-novice by date:

Previous
From: Keith Worthington
Date:
Subject: Re: CAST and timestamp
Next
From: Mike G
Date:
Subject: Re: CAST and timestamp