Re: pgsql: Add time/date macros for code clarity: #define

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pgsql: Add time/date macros for code clarity: #define
Дата
Msg-id 200507210446.j6L4k5u23784@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Add time/date macros for code clarity: #define DAYS_PER_YEAR  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Add time/date macros for code clarity: #define DAYS_PER_YEAR  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: pgsql: Add time/date macros for code clarity: #define DAYS_PER_YEAR  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
Tom Lane wrote:
> momjian@svr1.postgresql.org (Bruce Momjian) writes:
> > Log Message:
> > -----------
> > Add time/date macros for code clarity:
>
> >     #define DAYS_PER_YEAR   365.25
> >     #define MONTHS_PER_YEAR 12
> >     #define DAYS_PER_MONTH  30
> >     #define HOURS_PER_DAY   24
>
> Considering that only one of these four is actually an accurate
> constant, I have to question the usefulness of this.

Yea, the problem is that these non-absolute constants are littered all
through the code, so it is best to have them at least in one place.  I
will add a comment marking the non-accurate ones more clearly.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Remove unnecessary parentheses in assignments.
Следующее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Add comment marking non-exact time conversion macros.