pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gavin Flower <GavinFlower@archidevsys.co.nz>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Robert Young <yayooo@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost"
Date: Fri, 28 Oct 2011 08:03:09 +1300
Message-ID: <4EA9AAED.2090402@archidevsys.co.nz> (raw)
In-Reply-To: <4EA958F0.8050402@enterprisedb.com>
References: <CAJjz_Nhxdkr-0kx9F+VCTub1_kiXPyo5M-9v8Dn7N7y7PEPsXg@mail.gmail.com>
	<201110271412.02896.andres@anarazel.de>
	<CAJjz_NgWTo_VEhk2os_S1cbXRojP1dZfYozMWSHuH_BU918SpQ@mail.gmail.com>
	<4EA958F0.8050402@enterprisedb.com>

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

view thread (47+ messages)  latest in thread

Message-ID: <4EA9AAED.2090402@archidevsys.co.nz>
Permalink:  ../4EA9AAED.2090402@archidevsys.co.nz/
Also on:    postgresql.org/message-id/4EA9AAED.2090402@archidevsys.co.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: GavinFlower@archidevsys.co.nz, heikki.linnakangas@enterprisedb.com, yayooo@gmail.com, andres@anarazel.de
  Subject: Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost"
  In-Reply-To: <4EA9AAED.2090402@archidevsys.co.nz>
  References: <CAJjz_Nhxdkr-0kx9F+VCTub1_kiXPyo5M-9v8Dn7N7y7PEPsXg@mail.gmail.com> <201110271412.02896.andres@anarazel.de> <CAJjz_NgWTo_VEhk2os_S1cbXRojP1dZfYozMWSHuH_BU918SpQ@mail.gmail.com> <4EA958F0.8050402@enterprisedb.com> <4EA9AAED.2090402@archidevsys.co.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox