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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pgsql: Add time/date macros for code clarity: #define
Дата
Msg-id 200507210513.j6L5DqL06813@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: pgsql: Add time/date macros for code clarity: #define  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Add time/date macros for code clarity:  ("Marc G. Fournier" <scrappy@postgresql.org>)
Список pgsql-committers
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom Lane wrote:
> >> In short, I don't think this is an improvement.
>
> > The problem is that 24 or 30 or 60 doesn't really say what it is, while
> > the macros are self-documenting.
>
> Except that they're NOT.
>
> Anyone who is reading datetime code will be entirely familiar with the
> Gregorian calendar (and if they aren't, the macro names you propose are
> not going to help them).  You cannot honestly sit there and say that
> "365" or "24" isn't going to convey anything to anyone who could
> usefully read the code in the first place.
>
> > What we can do is to rename them to AVG_* macros so it is clear it is
> > approximate.
>
> But still not clear which approximation is being used.  And in most
> places where this might be used, that matters.

Well, if you want to see the approximation, look at the macro value.  At
least with AVG we are documenting it is an approximation, and are doing
it consistently.

--
  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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pgsql: Add time/date macros for code clarity: #define
Следующее
От: momjian@svr1.postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Fix integer timestamp build for macro changes.