Re: Imprecision of DAYS_PER_MONTH

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Imprecision of DAYS_PER_MONTH
Дата
Msg-id 200507211806.j6LI6MD23609@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Imprecision of DAYS_PER_MONTH  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Another problem with this patch is the search-and-replace substitution
> of "SECS_PER_MINUTE" for "60", when in point of fact there are two
> different meanings of "60" in this context.  For instance, this
> code has no problem:
> 
> ! int            Log_RotationAge = 24 * 60;
> 
> but this code looks like it has a units error:
> 
> ! int            Log_RotationAge = HOURS_PER_DAY * SECS_PER_MINUTE;
> 
> You need a "MINS_PER_HOUR" or some such if you don't want people
> having to look twice at the code.
> 
> BTW, if you actually wanted to improve readability, defining a
> SECS_PER_YEAR value and replacing the various occurrences of
> "36525 * 864" with it would help.

Good idea, both done.

--  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,
Pennsylvania19073
 


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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: checkpoint_segments 32 megs?
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Constraint Exclusion on all tables