Re: pgsql: Document that age() adds days, then full months.

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pgsql: Document that age() adds days, then full months.
Дата
Msg-id 200707182233.l6IMXcq27422@momjian.us
обсуждение исходный текст
Ответ на Re: pgsql: Document that age() adds days, then full months.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Document that age() adds days, then full months.  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-committers
Tom Lane wrote:
> momjian@postgresql.org (Bruce Momjian) writes:
> > Document that age() adds days, then full months.
>
> AFAICT, this documentation "improvement" is outright wrong.

I am now thinking no documentation paragraph is even needed. We have to
use the number of months in the earlier date or simple computations
would not work like:

    test=> select age('2004-05-29', '2004-06-28');
       age
    ----------
     -30 days
    (1 row)

The end of the earlier month is part of the interval between the two
timestamps, while the end of the later month is not.  Of course with a
multi-months span there are more chances for variance, but we certainly
should give the right answer for an interval < 1 month.  I can just add
a C comment.

--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

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

Предыдущее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Fix an old thinko in SS_make_initplan_from_plan, which is used
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: Adjust configure script to print the bison and flex versions in