Re: Time and date functions give me headaches!!

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Costin Manda" <siderite(at)madnet(dot)ro>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Time and date functions give me headaches!!
Date: 2005-04-11 14:33:23
Message-ID: 29604.1113230003@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Costin Manda" <siderite(at)madnet(dot)ro> writes:
> select setuptime::timestamp from billing; - error (cannot cast type
> character varying to timestamp without timezone!?)

It works for me in 8.0. In some releases you need to cast to text
first, for example in 7.4:

regression=# select '2005-10-10 10:10:10'::varchar::timestamp;
ERROR: cannot cast type character varying to timestamp without time zone
regression=# select '2005-10-10 10:10:10'::varchar::text::timestamp;
timestamp
---------------------
2005-10-10 10:10:10
(1 row)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-04-11 14:45:37 Re: Inserting a record data type into a table
Previous Message Tom Lane 2005-04-11 14:05:03 Re: pg 8.0.1-r3 killls pgadmin3 and phppgadmin