Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0f3r-0001qg-37 for pgsql-admin@arkaria.postgresql.org; Wed, 30 Jan 2013 21:19:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1U0f3m-0003SA-Qj for pgsql-admin@arkaria.postgresql.org; Wed, 30 Jan 2013 21:19:10 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0f3l-0003S3-Lw for pgsql-admin@postgresql.org; Wed, 30 Jan 2013 21:19:10 +0000 Received: from pro-open.de ([87.106.136.39] helo=www.pro-open.de) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1U0f3j-0002b6-GH for pgsql-admin@postgresql.org; Wed, 30 Jan 2013 21:19:08 +0000 Received: from [192.168.1.10] (ip-176-198-223-42.unitymediagroup.de [176.198.223.42]) by www.pro-open.de (Postfix) with ESMTP id 7C901100A09F; Wed, 30 Jan 2013 22:19:05 +0100 (CET) Message-ID: <51098E49.9020701@pro-open.de> Date: Wed, 30 Jan 2013 22:19:05 +0100 From: "Gunnar \"Nick\" Bluth" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: =?UTF-8?B?U3RyYWhpbmphIEt1c3R1ZGnEhw==?= CC: "Rajagopalan, Jayashree" , "pgsql-admin@postgresql.org" Subject: Re: postgres 9.0 - unable to bind to localhost. References: <672B315321EBEC4CA4B5627D112E0896067F53F7D4@MX25A.corp.emc.com> <672B315321EBEC4CA4B5627D112E0896067F53F7E4@MX25A.corp.emc.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------060305050105020804080906" X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org This is a multi-part message in MIME format. --------------060305050105020804080906 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Am 23.12.2012 12:38, schrieb Strahinja Kustudi=C4=87: > Sorry for a late reply, but I had the exact same problem and it was a=20 > bug in the Red Hat RPM package upgrade script of the sudo package.=20 > This basically means the user running Postgres cannot resolve hostname=20 > localhost. Have you tried logging in as the user running Postgres and=20 > trying to resolve localhost? In RHEL/Centos you would do this with: > > *su - postgres* > *nslookup localhost* > A late comment on this one... but I've learnt this lesson the hard way :/ If you want to know what am actual program will get, use "getent hosts=20 ", that will follow the directions in nsswitch.conf and=20 also use an nscd, if you're running one. So, if someone (for whatever reason) once put a line 1.2.3.4 localhost in your /etc/hosts, the "nslookup" will return what you'd expect (i.e.,=20 hopefully ;-), but Postgres will try to open a socket on 1.2.3.4. Bang! Apart from that: a) nslookup is deprecated since ages, use "host" or "dig" (well, no, use=20 "getent hosts" ;-) b) I doubt that all DNS possible servers (M$ ones spring to mind...)=20 will provide answers to "localhost" Just my 2p... --=20 Gunnar "Nick" Bluth RHCE/SCLA Mobil +49 172 8853339 Email: gunnar.bluth@pro-open.de _________________________________________________________________________= _ In 1984 mainstream users were choosing VMS over UNIX. Ten years later they are choosing Windows over UNIX. What part of that message aren't yo= u getting? - Tom Payne --------------060305050105020804080906 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Am 23.12.2012 12:38, schrieb Strahinja Kustudi=C4=87:
Sorry for a late reply, but I had the exact same problem and it was a bug in the Red Hat RPM package upgrade script of the sudo package. This basically means the user running Postgres cannot resolve hostname localhost. Have you tried logging in as the user running Postgres and trying to resolve localhost? In RHEL/Centos you would do this with:

su - postgres
nslookup localhost


A late comment on this one... but I've learnt this lesson the hard way :/
If you want to know what am actual program will get, use "getent hosts <hostname/IP>", that will follow the directions in nsswitch.conf and also use an nscd, if you're running one.

So, if someone (for whatever reason) once put a line
=C2=A0=C2=A0=C2=A0 1.2.3.4 localhost
in your /etc/hosts, the "nslookup" will return what you'd expect (i.e., hopefully ;-), but Postgres will try to open a socket on 1.2.3.4. Bang!

Apart from that:
a) nslookup is deprecated since ages, use "host" or "dig" (well, no, use "getent hosts" ;-)
b) I doubt that all DNS possible servers (M$ ones spring to mind...) will provide answers to "localhost"

Just my 2p...
--=20
Gunnar "Nick" Bluth
RHCE/SCLA

Mobil   +49 172 8853339
Email: gunnar.bluth@pro-open.de
_________________________________________________________________________=
_
In 1984 mainstream users were choosing VMS over UNIX.  Ten years later
they are choosing Windows over UNIX.  What part of that message aren't yo=
u
getting? - Tom Payne
--------------060305050105020804080906--