Re: CAST and timestamp - Mailing list pgsql-novice

From Keith Worthington
Subject Re: CAST and timestamp
Date
Msg-id 41C79D1B.5020104@NarrowPathInc.com
Whole thread Raw
In response to Re: CAST and timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CAST and timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: CAST and timestamp  (Mike G <mike@thegodshalls.com>)
List pgsql-novice
Tom Lane wrote:

>"Keith Worthington" <keithw@narrowpathinc.com> writes:
>
>
>>IPADB=# SELECT CAST(scan_date || scan_time AS timestamp) AS datetime_timestamp
>>FROM data_transfer.tbl_inventory_scanner;
>>ERROR:  Cannot cast type character to timestamp without time zone
>>
>>
>
>
>
>>IPADB=# SELECT employee_id, item_id, CAST(quantity AS float4) AS quantity FROM
>>data_transfer.tbl_inventory_scanner;
>>ERROR:  Cannot cast type character varying to real
>>
>>
>
>Try casting the inputs to type "text" and then to timestamp or real.
>
>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
Tom,

Are you saying that I should try something like

CAST( CAST( quantity AS text ) AS float4) AS quantity

--
Kind Regards,
Keith


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Inheritance
Next
From: Tom Lane
Date:
Subject: Re: CAST and timestamp