Re: operator does not exist: timestamp w/out timezone (similar to bug 3807)

Поиск
Список
Период
Сортировка
От Guillaume Smet
Тема Re: operator does not exist: timestamp w/out timezone (similar to bug 3807)
Дата
Msg-id 1d4e0c10804120147j48126171w589a2e142bd16c69@mail.gmail.com
обсуждение исходный текст
Ответ на operator does not exist: timestamp w/out timezone (similar to bug 3807)  (philwalk <nomaps@frii.com>)
Список pgsql-bugs
On Sat, Apr 12, 2008 at 4:53 AM, philwalk <nomaps@frii.com> wrote:
>  CREATE TABLE
>  psql:pg83bug.sql:16: ERROR:  operator does not exist: timestamp without
>  time zone ~~ unknown
>  LINE 3:     where date like '2007-01-19%';
>                        ^
>  HINT:  No operator matches the given name and argument type(s). You
>  might need to add explicit type casts.

This isn't a bug. 8.3 removes a bunch of implicit casts to text which
led to unappropriate behaviours. Prior to 8.3, your timestamp was
casted to text implicitely.

Just use date_trunc
(http://www.postgresql.org/docs/current/static/functions-datetime.html):
update bugtab set
   pnum = -8.6
   where date_trunc('day', date) = '2007-01-19';

You can add a functional index on date_trunc('day', date) if necessary.

--
Guillaume

В списке pgsql-bugs по дате отправления:

Предыдущее
От: jalvarez
Дата:
Сообщение: error php - postgresql
Следующее
От: "Guillaume Smet"
Дата:
Сообщение: Re: error php - postgresql