Re: query by partial timestamp

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: Gavan Schneider <pg-gts(at)snkmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: query by partial timestamp
Date: 2013-01-09 17:47:59
Message-ID: CAOzAquJ+3Y2dMWiSCCrMNvFfp=sbHLeCZk5pGFHgcOAh8b1Y9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It is probably not the most efficient, but I often use this syntax,
which reads better.

Select ..... where col_type_timestamp::date between '2011-01-01' and
'2011-12-31'

This will use a timestamp index.
--
Mike Nolan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2013-01-09 18:09:37 Re: query by partial timestamp
Previous Message Michael Nolan 2013-01-09 17:42:02 Re: query by partial timestamp