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 Novice > Re: Calculating...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 5 Topic 3154 of 3255
Post > Topic >>

Re: Calculating repeating events - functionality lost with the demise of tinterval ?

by tgl@[EMAIL PROTECTED] (Tom Lane) Jul 2, 2008 at 01:01 PM

Daniel <psql-novice@[EMAIL PROTECTED]
> writes:
>> If that doesn't satisfy your requirements, you need to be more clear
>> about what they are.

> Apologies for the lack of clarity.
> Try repeat_frequency='1 month'

Ah.  Well, with something like that, you really can't speak in terms of
modulo, because months aren't all the same length.  I'd be inclined to
solve this with a small plpgsql function, along the lines of

	curdate := start_date;
	while curdate < test_date loop
		curdate := curdate + repeat_interval;
	end loop;
	return (curdate = test_date);

Kinda grotty but there probably isn't any cleaner solution that really
works for arbitrary intervals.

			regards, tom lane

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




 5 Posts in Topic:
Calculating repeating events - functionality lost with the demis
psql-novice@[EMAIL PROTEC  2008-07-02 13:21:01 
Re: Calculating repeating events - functionality lost with the d
tgl@[EMAIL PROTECTED] (T  2008-07-02 10:57:55 
Re: Calculating repeating events - functionality lost with
psql-novice@[EMAIL PROTEC  2008-07-02 18:37:28 
Re: Calculating repeating events - functionality lost with the d
tgl@[EMAIL PROTECTED] (T  2008-07-02 13:01:59 
Re: Calculating repeating events - functionality lost with
psql-novice@[EMAIL PROTEC  2008-07-03 12:29:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Sat Oct 11 6:29:41 CDT 2008.