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

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: '1 year' = '360 days' ????
Дата
Msg-id 20041024045120.GA16743@wolff.to
обсуждение исходный текст
Ответ на Re: '1 year' = '360 days' ????  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: '1 year' = '360 days' ????  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
On Sat, Oct 23, 2004 at 23:15:57 -0500,
  Bruno Wolff III <bruno@wolff.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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Linking question
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: '1 year' = '360 days' ????