Re: date ranges in where - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: date ranges in where
Date
Msg-id 4A02D042.9090907@iol.ie
Whole thread Raw
In response to Re: date ranges in where  (Jasen Betts <jasen@xnet.co.nz>)
List 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@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: date ranges in where
Next
From: Raymond O'Donnell
Date:
Subject: Re: Upgrading from postgres 8.1 to 8.3