Search Postgresql Archives

Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist

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

 



Nico Grubert <nicogrubert@xxxxxxxxx> writes:
>    SELECT a.*
>    FROM tblevent a
>    WHERE to_timestamp(a.from_datetime,'YYYY/MM/DD') >= to_timestamp( 
> NOW(),'YYYY/MM/DD' )
>    ORDER BY a.from_datetime

> In PostgreSQL 8.2.6 everything works fine.
> In PostgreSQL 8.3.6 I get the following error:
> ------------------------------------------------------------------------
> ERROR:  function to_timestamp(timestamp without time zone, unknown) does 
> not exist

This query makes little sense.  Why are you trying to convert a
timestamp to a timestamp?  Is this a bizarre substitute for date_trunc()?

The reason it "works" in 8.2 is that 8.2 will allow an implicit coercion
from timestamp to text --- although I put "work" in quotes because it
will not work too well if datestyle is anything but the default.  You
could make it not-quite-work the same in 8.3 by adding an explicit
coercion of from_datetime to text, but I think you ought to read up on
date_trunc instead.

			regards, tom lane

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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