Re: Macros for time magic values - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Macros for time magic values
Date
Msg-id 9024.1300115621@sss.pgh.pa.us
Whole thread Raw
In response to Re: Macros for time magic values  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Macros for time magic values
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Mar 14, 2011 at 4:22 AM, Simon Riggs <simon@2ndquadrant.com> wrote:
>> On Sat, 2011-03-12 at 22:29 +0200, Peter Eisentraut wrote:
>>> I think it's much clearer with the plain numbers.

>> Yeh. It's not like the values 24, 12 or 60 were going to change.

> I had the same thought.  OTOH, even in 9.0 we have constants for
> BITS_PER_BYTE, DAYS_PER_YEAR (365.25), MONTHS_PER_YEAR, DAYS_PER_MONTH
> (30, as it turns out), HOURS_PER_DAY, SECS_PER_YEAR (that's a
> constant?), SECS_PER_DAY, SECS_PER_HOUR, MINS_PER_HOUR, USECS_PER_DAY,
> USECS_PER_HOUR, USECS_PER_MINUTE, and USECS_PER_SEC.  And there's no
> real reason to use those symbols in only some of the contexts where
> they are relevant.

Well, those existing symbols are there because Bruce put them in in
previous iterations of this same sort of patch.  And as you note,
some of them are pretty darn questionable because the underlying
number *isn't* as well defined as all that.

If Bruce is the only person who finds this to be a readability
improvement, maybe we should think about backing all of those
changes out.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Better estimates of index correlation
Next
From: Tom Lane
Date:
Subject: Re: Indent authentication overloading