Nico Grubert <nicogrubert@gmail.com> 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