Re: CAST and timestamp - Mailing list pgsql-novice

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

pgsql-novice by date:

Previous
From: Steve Crawford
Date:
Subject: Re: SQUID Log in PostgreSQL
Next
From: Hasnul Fadhly bin Hasan
Date:
Subject: Inheritance