Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 2C0DB2E00A8 for ; Thu, 24 Apr 2008 13:08:03 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 98154-03-6 for ; Thu, 24 Apr 2008 13:07:52 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pyxis.powervt.com.ar (host6.powervt.com.ar [200.43.63.66]) by developer.postgresql.org (Postfix) with ESMTP id 04CAA2E00A5 for ; Thu, 24 Apr 2008 13:07:28 -0300 (ADT) Received: from pcfhevia ([201.216.249.98]) by pyxis.powervt.com.ar (IPGroup Mail Server) with ESMTP id 1OT48953; Thu, 24 Apr 2008 13:07:27 -0300 From: "Fernando Hevia" To: "'Scott Marlowe'" Cc: References: <481085D1.2010807@sympatico.ca> <48108813.6070401@sympatico.ca> <481095FB.7090600@denterprises.org> <023b01c8a61d$5855cea0$8f01010a@iptel.com.ar> Subject: Re: First day of month, last day of month Date: Thu, 24 Apr 2008 13:07:19 -0300 Organization: IP-TEL Message-ID: <024501c8a625$4590fdf0$8f01010a@iptel.com.ar> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: Thread-Index: AcimIjsP3NNGeZGgRJWxh/Qe6YwUmQAAfODQ X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/171 X-Sequence-Number: 30710 > -----Mensaje original----- > De: Scott Marlowe [mailto:scott.marlowe@gmail.com] > > > Note that if you are storing your time stamp as timestamptz, > you can use the "at time zone 'xyz'" construct to create an > index, and as long as you retrieve them with the same > construct you'll get to use the index. > > create index test_ts_month_trunc on testtable > (date_trunc('month',(ts at time zone 'MST'))); > select * from testtable > where date_trunc('month',(ts at time zone 'MST'))='2007-10-01 00:00:00'::timestamp; > I see the point. Thanks for the elaboration.