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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist
Дата
Msg-id 8259.1236278544@sss.pgh.pa.us
обсуждение исходный текст
Ответ на After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist  (Nico Grubert <nicogrubert@gmail.com>)
Ответы Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist  (Nico Grubert <nicogrubert@gmail.com>)
Re: After Upgrade from 8.2.6 to 8.3.6: function to_timestamp does not exist  (Nico Grubert <nicogrubert@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Problem with SSL: "could not accept SSL connection: EOF detected"
Следующее
От: Pat Maddox
Дата:
Сообщение: Re: Problem with SSL: "could not accept SSL connection: EOF detected"