Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add time/date macros for code clarity: #define
Date: 2005-07-21 05:08:31
Message-ID: 15527.1121922511@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committers
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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.

			regards, tom lane

In response to

Responses

pgsql-committers by date

Next:From: Bruce MomjianDate: 2005-07-21 05:11:59
Subject: Re: pgsql: Add time/date macros for code clarity: #define
Previous:From: Marc G. FournierDate: 2005-07-21 05:02:28
Subject: Re: pgsql: Add time/date macros for code clarity:

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group