Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: First day o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 15 Topic 3430 of 3631
Post > Topic >>

Re: First day of month, last day of month

by scott.marlowe@[EMAIL PROTECTED] ("Scott Marlowe") Apr 24, 2008 at 09:44 AM

On Thu, Apr 24, 2008 at 9:16 AM, Scott Marlowe <scott.marlowe@[EMAIL PROTECTED]
>
wrote:
> On Thu, Apr 24, 2008 at 9:10 AM, Fernando Hevia <fhevia@[EMAIL PROTECTED]
>
wrote:
>  >  > De: pgsql-sql-owner@[EMAIL PROTECTED]
>  >  > [mailto:pgsql-sql-owner@[EMAIL PROTECTED]
 En nombre de Scott Marlowe
>  >
>  > >
>  >  > Then you can just use date_trunc on the values in the
>  >  > database. Plus if you're using timestamp WITHOUT timezone,
>  >  > you can index on it.
>  >  >
>  >
>  >  Did not understand this. Are you saying timestamps WITH timezone are
NOT
>  >  indexable or you mean that you cant build a partial index on a
>  >  timestamp-with-time-zone returning function?
>
>  Correct, timestamptz or timestamp with timezone (timestamptz is the
>  shorter alias) are not indexable because functions in an index must be
>  immutable, and date_trunc on a timestamptz is not.

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;

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 15 Posts in Topic:
First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 14:59:47 
Re: First day of month, last day of month
fbax@[EMAIL PROTECTED] (  2008-04-24 09:06:25 
Re: First day of month, last day of month
fbax@[EMAIL PROTECTED] (  2008-04-24 09:16:03 
Re: First day of month, last day of month
andreas.kretschmer@[EMAIL  2008-04-24 15:15:36 
Re: First day of month, last day of month
cww@[EMAIL PROTECTED] (C  2008-04-24 10:15:23 
Re: First day of month, last day of month
erik@[EMAIL PROTECTED] (  2008-04-24 09:41:04 
Re: First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 16:43:40 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 08:55:31 
Re: First day of month, last day of month
fhevia@[EMAIL PROTECTED]   2008-04-24 12:10:34 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 08:56:50 
Re: First day of month, last day of month
erik@[EMAIL PROTECTED] (  2008-04-24 10:08:10 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 09:16:01 
Re: First day of month, last day of month
scott.marlowe@[EMAIL PROT  2008-04-24 09:44:44 
Re: First day of month, last day of month
fhevia@[EMAIL PROTECTED]   2008-04-24 13:07:19 
Re: First day of month, last day of month
nacef.l@[EMAIL PROTECTED]  2008-04-24 18:39:06 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 23:14:27 CDT 2008.