Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Bruno Wolff III
On Thu, Jul 21, 2005 at 13:47:29 -0700, Dann Corbit [EMAIL PROTECTED] wrote: In round figures: Since there are 365.2422 days per tropical year, there are 31556926 seconds per year (give or take leap seconds). Ref: http://www.grc.nasa.gov/WWW/K-12/Numbers/Math/Mathematical_Thinking/cale

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Bruce Momjian
Bruno Wolff III wrote: On Thu, Jul 21, 2005 at 13:47:29 -0700, Dann Corbit [EMAIL PROTECTED] wrote: In round figures: Since there are 365.2422 days per tropical year, there are 31556926 seconds per year (give or take leap seconds). Ref:

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Dann Corbit
'; Bruno Wolff III Cc: Greg Stark; Tino Wildenhain; Tom Lane; PostgreSQL-development; Marc G. Fournier Subject: RE: [HACKERS] Imprecision of DAYS_PER_MONTH 365.2425 is the exact value computed by the formulas found in the Gregorian calendar (a very good approximation of reality). 365.2422

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Dann Corbit
- From: Bruce Momjian [mailto:[EMAIL PROTECTED] Sent: Friday, July 22, 2005 12:03 PM To: Bruno Wolff III Cc: Dann Corbit; Greg Stark; Tino Wildenhain; Tom Lane; PostgreSQL- development; Marc G. Fournier Subject: Re: [HACKERS] Imprecision of DAYS_PER_MONTH Bruno Wolff III wrote: On Thu

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Bruno Wolff III
On Fri, Jul 22, 2005 at 12:27:50 -0700, Dann Corbit [EMAIL PROTECTED] wrote: Apparently, the Gregorian calendar has been fixed. From this: http://www.physics.uq.edu.au/people/ross/phys2081/time/calendar.htm We have this: The Gregorian calendar has been modified since (before anything

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Andrew - Supernews
On 2005-07-22, Bruce Momjian pgman@candle.pha.pa.us wrote: Bruno Wolff III wrote: According to the current calendar (again ignoring leap seconds) there are exactly 365.2425 days per year on average. I think it makes sense to use this number when dealing with calendar years and months.

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-22 Thread Andrew Dunstan
Bruno Wolff III wrote: On Fri, Jul 22, 2005 at 12:27:50 -0700, Dann Corbit [EMAIL PROTECTED] wrote: Apparently, the Gregorian calendar has been fixed. From this: http://www.physics.uq.edu.au/people/ross/phys2081/time/calendar.htm We have this: The Gregorian calendar has been modified

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruno Wolff III
On Thu, Jul 21, 2005 at 09:39:38 -0400, Bruce Momjian pgman@candle.pha.pa.us wrote: I have added this comment above the DAYS_PER_MONTH macro: + /* + *DAYS_PER_MONTH is very imprecise. The more accurate value is + *365.25/12 = 30.4375, or '30 days 10:30:00'.

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Tom Lane
Bruno Wolff III [EMAIL PROTECTED] writes: On Thu, Jul 21, 2005 at 09:39:38 -0400, Bruce Momjian pgman@candle.pha.pa.us wrote: Let me add that we could actually do this in many places now because we are already converting to 'time' in those places. Is this a TODO? Shouldn't you be using

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Tom Lane
Another problem with this patch is the search-and-replace substitution of SECS_PER_MINUTE for 60, when in point of fact there are two different meanings of 60 in this context. For instance, this code has no problem: ! int Log_RotationAge = 24 * 60; but this code looks like it

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Tino Wildenhain
Am Donnerstag, den 21.07.2005, 10:48 -0400 schrieb Tom Lane: Another problem with this patch is the search-and-replace substitution of SECS_PER_MINUTE for 60, when in point of fact there are two different meanings of 60 in this context. For instance, this code has no problem: ! int

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruce Momjian
Bruno Wolff III wrote: On Thu, Jul 21, 2005 at 09:39:38 -0400, Bruce Momjian pgman@candle.pha.pa.us wrote: I have added this comment above the DAYS_PER_MONTH macro: + /* + *DAYS_PER_MONTH is very imprecise. The more accurate value is + *365.25/12 = 30.4375,

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruce Momjian
Tino Wildenhain wrote: Am Donnerstag, den 21.07.2005, 10:48 -0400 schrieb Tom Lane: Another problem with this patch is the search-and-replace substitution of SECS_PER_MINUTE for 60, when in point of fact there are two different meanings of 60 in this context. For instance, this code has

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruce Momjian
Tom Lane wrote: Another problem with this patch is the search-and-replace substitution of SECS_PER_MINUTE for 60, when in point of fact there are two different meanings of 60 in this context. For instance, this code has no problem: ! int Log_RotationAge = 24 * 60; but

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Greg Stark
Bruce Momjian pgman@candle.pha.pa.us writes: BTW, if you actually wanted to improve readability, defining a SECS_PER_YEAR value and replacing the various occurrences of 36525 * 864 with it would help. IIRC the number of seconds in a year is far from a constant. Yes, I added a

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Dann Corbit
Message- From: [EMAIL PROTECTED] [mailto:pgsql-hackers- [EMAIL PROTECTED] On Behalf Of Bruce Momjian Sent: Thursday, July 21, 2005 1:35 PM To: Greg Stark Cc: Tino Wildenhain; Tom Lane; PostgreSQL-development; Marc G. Fournier Subject: Re: [HACKERS] Imprecision of DAYS_PER_MONTH Greg Stark

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruce Momjian
Greg Stark wrote: Bruce Momjian pgman@candle.pha.pa.us writes: BTW, if you actually wanted to improve readability, defining a SECS_PER_YEAR value and replacing the various occurrences of 36525 * 864 with it would help. IIRC the number of seconds in a year is far from a

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Ron Mayer
Bruno Wolff III wrote: Shouldn't you be using 365.2425/12 (30.436875) for the number of days per month? Well, ISO 8601 prefers 30 to some weird fraction when they define the term month; and uses a different term calendar month for the exact number of days in a known month. They make a

Re: [HACKERS] Imprecision of DAYS_PER_MONTH

2005-07-21 Thread Bruce Momjian
. --- -Original Message- From: [EMAIL PROTECTED] [mailto:pgsql-hackers- [EMAIL PROTECTED] On Behalf Of Bruce Momjian Sent: Thursday, July 21, 2005 1:35 PM To: Greg Stark Cc: Tino Wildenhain; Tom Lane; PostgreSQL-development; Marc G. Fournier Subject: Re: [HACKERS] Imprecision