Skip site navigation (1) Skip section navigation (2)

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 00:31:54
Message-ID: 29744.1103589114@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
"Keith Worthington" <keithw(at)narrowpathinc(dot)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

In response to

Responses

pgsql-novice by date

Next:From: Hasnul Fadhly bin HasanDate: 2004-12-21 03:21:55
Subject: Inheritance
Previous:From: Steve CrawfordDate: 2004-12-20 23:53:00
Subject: Re: SQUID Log in PostgreSQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group