Re: Problems with filter on timestamp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: alex(at)neteconomist(dot)com
Cc: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problems with filter on timestamp
Date: 2005-02-02 21:14:58
Message-ID: 6626.1107378898@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alex Turner <armtuk(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-02-02 21:16:03 Re: plpython.so
Previous Message Geoffrey 2005-02-02 20:03:02 Re: PostgreSQL Security Release