Re: Imprecision of DAYS_PER_MONTH - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Imprecision of DAYS_PER_MONTH
Date
Msg-id 19994.1121957286@sss.pgh.pa.us
Whole thread Raw
In response to Imprecision of DAYS_PER_MONTH  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Imprecision of DAYS_PER_MONTH  (Tino Wildenhain <tino@wildenhain.de>)
Re: Imprecision of DAYS_PER_MONTH  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
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.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Imprecision of DAYS_PER_MONTH
Next
From: Tino Wildenhain
Date:
Subject: Re: Imprecision of DAYS_PER_MONTH