Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fxz-0006u4-Pk for pgsql-general@arkaria.postgresql.org; Thu, 04 Feb 2021 14:50:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l7fxx-00036n-1w for pgsql-general@arkaria.postgresql.org; Thu, 04 Feb 2021 14:50:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fxw-00036g-Qt for pgsql-general@lists.postgresql.org; Thu, 04 Feb 2021 14:50:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7fxt-0007Tb-VH for pgsql-general@lists.postgresql.org; Thu, 04 Feb 2021 14:50:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 114EoWmF4093910; Thu, 4 Feb 2021 09:50:32 -0500 From: Tom Lane To: Joao Miguel Ferreira cc: depesz@depesz.com, pgsql-general Subject: Re: cant connect to localhost:5432 (but unix socket ok) In-reply-to: References: <20210204142627.GA22609@depesz.com> Comments: In-reply-to Joao Miguel Ferreira message dated "Thu, 04 Feb 2021 14:36:28 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4093908.1612450232.1@sss.pgh.pa.us> Date: Thu, 04 Feb 2021 09:50:32 -0500 Message-ID: <4093909.1612450232@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Joao Miguel Ferreira writes: > On Thu, Feb 4, 2021 at 2:26 PM hubert depesz lubaczewski > wrote: >>> My database is not listening on TCP/localhost, desptite it is listening >>>> on the unix socket. How can I investigate this? > it's on 5433: Hmm, something odd there, because a port number mismatch should have resulted in psql failing to connect via unix socket either. Maybe you have more than one active postmaster? Anyway, given these settings, "psql -p 5433 -h localhost" should connect. If you still get "connection refused" then you need to look at the kernel firewall (packet filter) settings. regards, tom lane