Search Postgresql Archives

Re: Time and date functions give me headaches!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Costin Manda" <siderite@xxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux