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

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: philwalk <nomaps(at)frii(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: operator does not exist: timestamp w/out timezone (similar to bug 3807)
Date: 2008-04-12 08:47:06
Message-ID: 1d4e0c10804120147j48126171w589a2e142bd16c69@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Apr 12, 2008 at 4:53 AM, philwalk <nomaps(at)frii(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Guillaume Smet 2008-04-12 08:53:05 Re: error php - postgresql
Previous Message philwalk 2008-04-12 02:53:40 operator does not exist: timestamp w/out timezone (similar to bug 3807)