View Single Post

   
  #2 (permalink)  
Old 04-15-2008, 08:35 PM
Guillaume Smet
 
Posts: n/a
Default Re: operator does not exist: timestamp w/out timezone (similar to bug 3807)

On Sat, Apr 12, 2008 at 4:53 AM, philwalk <nomaps@frii.com> wrote:
> CREATE TABLE
> psqlg83bug.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/curre...atetime.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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply With Quote