Re: Problems with filter on timestamp - Mailing list pgsql-general

From Alex Turner
Subject Re: Problems with filter on timestamp
Date
Msg-id 33c6269f050202193118c60942@mail.gmail.com
Whole thread Raw
In response to Re: Problems with filter on timestamp  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Yes - I am a complete idiot:

The query is indeed completely wrong, it should be current_timestamp
not current_time.  I finaly figured this out after staring at the
screen for twenty minutes trying to figure out what was going wrong.

DOH!

Alex Turner
NetEconomist


On Wed, 02 Feb 2005 16:14:58 -0500, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Alex Turner <armtuk@gmail.com> writes:
> >    ->  Seq Scan on weblog_entry  (cost=0.00..940.85 rows=4452 width=40)
> >          Filter: ((request_time)::text > ((('now'::text)::time(6) with
> > time zone - '00:01:00'::interval))::text)
>
> > This explain plain seems to me to be saying that it's casting the
> > timestamp to a text type before comparing with my
> > current_time-interval.
>
> Yup.
>
> > Is this the right behaviour?
>
> Hard to say.  You did not say what the datatype of request_time is.
>
> The whole thing looks a bit bogus though --- isn't it going to fail near
> midnight due to wraparound?  Seems like you should be using timestamps
> not times of day.
>
>                         regards, tom lane
>
>

pgsql-general by date:

Previous
From: mstory@uchicago.edu
Date:
Subject: multidimensional arrays
Next
From: Tom Lane
Date:
Subject: Re: multidimensional arrays