Re: pgsql: Add time/date macros for code clarity: #define - Mailing list pgsql-committers

From Bruce Momjian
Subject Re: pgsql: Add time/date macros for code clarity: #define
Date
Msg-id 200507210446.j6L4k5u23784@candle.pha.pa.us
Whole thread Raw
In response to Re: pgsql: Add time/date macros for code clarity: #define DAYS_PER_YEAR  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses 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>)
List 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 by date:

Previous
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Remove unnecessary parentheses in assignments.
Next
From: momjian@svr1.postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: Add comment marking non-exact time conversion macros.