Re: Time and date functions give me headaches!! - Mailing list pgsql-general

From Tom Lane
Subject Re: Time and date functions give me headaches!!
Date
Msg-id 29604.1113230003@sss.pgh.pa.us
Whole thread Raw
In response to Time and date functions give me headaches!!  ("Costin Manda" <siderite@madnet.ro>)
List pgsql-general
"Costin Manda" <siderite@madnet.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg 8.0.1-r3 killls pgadmin3 and phppgadmin
Next
From: Tom Lane
Date:
Subject: Re: Inserting a record data type into a table