Re: date ranges in where

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: date ranges in where
Date: 2009-05-07 12:12:50
Message-ID: 4A02D042.9090907@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/05/2009 12:59, Jasen Betts wrote:
> where lastlogin::date between '2009-05-01'::date and '2009-05-02'::date
>
> If you leave it uncast postgres will probably convert the lastlogin to
> a string and produce results other than that desired and proabaly
> take longer to do it too.

The OP was basing the query on a timestamp column, so I'd say Postgres
was casting everything to timestamp, with the results he reported.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2009-05-07 12:14:42 Re: Is thre a way?
Previous Message Jasen Betts 2009-05-07 11:59:38 Re: date ranges in where