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

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: '1 year' = '360 days' ????
Дата
Msg-id 20041024161749.GA4583@wolff.to
обсуждение исходный текст
Ответ на Re: '1 year' = '360 days' ????  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Sun, Oct 24, 2004 at 11:29:13 -0400,
  Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Question to think about: should we allow fractional months or days in
> the stored representation?  There are some places where the existing
> restriction that the months field is an integer requires awkward
> compromises.  On the other hand, it's not real clear what a fractional
> month actually means, and similarly a fractional day is hard to assign
> meaning to without positing that 1 day == 24 hours.

There are reasonable addition and subtraction operation definitions
on two intervals. There might be some application where you want to
keep track of fractional months or days. What I am not sure of is
would you really have a reason to add fractional months or days
to a timestamp. There are a couple reasonable definitions you might
make for this definition, but I don't really see a good reason to
want this. ne thing to note, when adding intervals you can add the
fractions normally. When adding to a date you can get the actual length
of the day or month the fractional part adds to, if you wanted to use
that information. (Though the resulting day or month may not be the
one you added the fractional month to.)

I think starting with a type where months and days were integers would be
OK, since you could generalize it to handle fractional months and days
later and not break applications.

Another thing to think about when designing this type, is that when
adding timestamps and intervals it makes a difference in which order
you add the months, days and seconds.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: '1 year' = '360 days' ????
Следующее
От: Jonathan Weiss
Дата:
Сообщение: Re: Problem with 7.4.1 and complicated queries