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 2 of 5 Topic 3154 of 3191
Post > Topic >>

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

by tgl@[EMAIL PROTECTED] (Tom Lane) Jul 2, 2008 at 10:57 AM

Netzach <psql-novice@[EMAIL PROTECTED]
> writes:
> I need to know whether a repeating event occurs or not on a particular
> day. I currently have the following information:<br>
> <br>
> date of first occurrence (date)<br>
> repeat frequency (interval)<br>
> date to check (date)<br>
> <br>
> My instinct says that I should be using a mod here to calculate whether
> the remainder is zero when the difference between the two times is
> divided by the repeat frequency. Unfortunately this is not possible
> since as far as I am aware intervals only specify a time length and not
> two dates.

Huh?  If you only need this good to day precision, as your reference to
dates suggests, then just subtract the two dates (which will give an
integer number of days) and modulo by the repeat frequency (also given
as an integer number of days).

If that doesn't satisfy your requirements, you need to be more clear
about what they are.

> When searching I discovered tinterval which appears to do
> what I would want, and was surprised to discover that it is not
> sup****ted in my postgres install because it is too _new_ !?! (PG
8.1).<br>

Actually tinterval is ancient and deprecated.  But I don't see how
it would apply to your problem as stated.

			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 Thu Aug 21 18:34:31 CDT 2008.