Re: First day of month, last day of month - Mailing list pgsql-sql

From Fernando Hevia
Subject Re: First day of month, last day of month
Date
Msg-id 024501c8a625$4590fdf0$8f01010a@iptel.com.ar
Whole thread Raw
In response to Re: First day of month, last day of month  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-sql
 

> -----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.




pgsql-sql by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: First day of month, last day of month
Next
From: Tarlika Elisabeth Schmitz
Date:
Subject: Re: extracting words