Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id A1F4BB5DC43 for ; Thu, 27 Oct 2011 16:03:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 18516-08 for ; Thu, 27 Oct 2011 19:03:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mbx.knossos.net.nz (mbx.knossos.net.nz [202.160.48.10]) by mail.postgresql.org (Postfix) with ESMTP id E7DFAB5DC42 for ; Thu, 27 Oct 2011 16:03:28 -0300 (ADT) Received: from [10.1.1.3] (60-234-150-59.bitstream.orcon.net.nz [60.234.150.59]) (authenticated bits=0) by mbx.knossos.net.nz (8.14.4/8.14.4) with ESMTP id p9RJ397R008717 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 28 Oct 2011 08:03:10 +1300 Message-ID: <4EA9AAED.2090402@archidevsys.co.nz> Date: Fri, 28 Oct 2011 08:03:09 +1300 From: Gavin Flower Organization: ArchiDevSys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Heikki Linnakangas CC: Robert Young , Andres Freund , pgsql-bugs@postgresql.org Subject: Re: Add statistics_collector_listen_addresses to fix hard-coding of "localhost" References: <201110271412.02896.andres@anarazel.de> <4EA958F0.8050402@enterprisedb.com> In-Reply-To: <4EA958F0.8050402@enterprisedb.com> Content-Type: multipart/alternative; boundary="------------040404060505080302070408" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201110/266 X-Sequence-Number: 31536 This is a multi-part message in MIME format. --------------040404060505080302070408 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------040404060505080302070408 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit 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
--------------040404060505080302070408--