Re: '1 year' = '360 days' ????

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Doug McNaught <doug(at)mcnaught(dot)org>, Ricardo Perez Lopez <ricpelo(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: '1 year' = '360 days' ????
Date: 2004-10-24 04:51:20
Message-ID: 20041024045120.GA16743@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Oct 23, 2004 at 23:15:57 -0500,
Bruno Wolff III <bruno(at)wolff(dot)to> wrote:
> by comparing say m1 and m2. This will work as long as f(m,s1) = f(m,s2)
> implies s1 = s2. It will probably be desirable to use a subset of these
> mappings where f(m,s) = g(m) + h(s). In fact the current system uses
> this with g(m) = 30*24*60*60*m and h(s) = s (but without the tiebreak
> that compares m values). Because of the way intervals work, I think
> you want to use an ordering generated like that you want to use
> something of the form f(m,s) = C1*m + C2*s. I also think that treating
> a month as 30 days and having round numbers is better than using
> something like 1/12 a solar year in seconds. So I think the best plan
> is to do things as they are now, except for adding a tie breaker just
> using months or seconds for when both intervals give the same number of
> seconds when treating months as 30 days, but have a different number of
> months.

Some more comments on this. I was thinking about it a bit more and using
1/12 of the number of seconds in a solar year doesn't seem that bad
for comparisons. That way 366 days > 1 year > 365 days. However, if you
go that route, I think you would also want to change EXTRACT so that
when you extract the EPOCH you use the same function as for comparison.
One value I found for a solar year is 365 days, 5 hours, 48 minutes, 45.51
seconds.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-10-24 05:22:41 Re: '1 year' = '360 days' ????
Previous Message Michael Fuhr 2004-10-24 04:39:36 Re: Linking question