Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist - Mailing list pgsql-general

From Tom Lane
Subject Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
Date
Msg-id 8259.1236278544@sss.pgh.pa.us
Whole thread Raw
In response to After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist  (Nico Grubert <nicogrubert@gmail.com>)
Responses Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Problem with SSL: "could not accept SSL connection: EOF detected"
Next
From: Pat Maddox
Date:
Subject: Re: Problem with SSL: "could not accept SSL connection: EOF detected"