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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-novice by date

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