Skip site navigation (1) Skip section navigation (2)

Re: First day of month, last day of month

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: "'Scott Marlowe'" <scott(dot)marlowe(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: First day of month, last day of month
Date: 2008-04-24 16:07:19
Message-ID: 024501c8a625$4590fdf0$8f01010a@iptel.com.ar (view raw or flat)
Thread:
Lists: pgsql-sql
 

> -----Mensaje original-----
> De: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)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.



In response to

pgsql-sql by date

Next:From: Tarlika Elisabeth SchmitzDate: 2008-04-24 16:12:41
Subject: Re: extracting words
Previous:From: Scott MarloweDate: 2008-04-24 15:44:44
Subject: Re: First day of month, last day of month

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group