Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost"

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Robert Young <yayooo(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost"
Date: 2011-10-27 19:03:09
Message-ID: 4EA9AAED.2090402@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 28/10/11 02:13, Heikki Linnakangas wrote:
> On 27.10.2011 15:57, Robert Young wrote:
>> But,I think insistence of hard-coding should be even worse than broken
>> configuration.
>> And hard-coding should never be a good work ethics of a professional
>> programmer.
>
> You're exaggerating. There's nothing wrong hard-coding things like
> number of seconds in a minute (60). While it's not as cast in stone as
> 60 seconds in a minute, I don't see anything wrong with hardcoding
> that "localhost" means the local host.
>
> BTW, do we have anything in place to stop any user on the same host to
> send bogus stat messages to the stats collector?
>
Actually, a minute is not always 60 seconds, as you can legally have 62
seconds in a minute!

From the documentation for the Java class *java.util.Date*:

[...]
A second is represented by an integer from 0 to 61; the values 60
and 61 occur only for leap seconds and even then only in Java
implementations that actually track leap seconds correctly. Because
of the manner in which leap seconds are currently introduced, it is
extremely unlikely that two leap seconds will occur in the same
minute, but this specification follows the date and time conventions
for ISO C.
[...]

Cheers,
Gavin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2011-10-27 19:53:08 Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost"
Previous Message Tom Lane 2011-10-27 18:18:53 Re: BUG #6264: Superuser does not have inherent Replication permission