Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7iQX-006Q03-JA for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 20:41:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r7iQW-00GRkT-8r for pgsql-general@arkaria.postgresql.org; Mon, 27 Nov 2023 20:41:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7iQV-00GRjJ-UH for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 20:41:55 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r7iQT-007epm-Iu for pgsql-general@lists.postgresql.org; Mon, 27 Nov 2023 20:41:54 +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 3ARKfoLb4007722; Mon, 27 Nov 2023 15:41:50 -0500 From: Tom Lane To: Adrian Klaver cc: Atul Kumar , Ron Johnson , pgsql-general Subject: Re: IPV6 issue In-reply-to: References: Comments: In-reply-to Adrian Klaver message dated "Mon, 27 Nov 2023 12:31:07 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <4007720.1701117710.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 27 Nov 2023 15:41:50 -0500 Message-ID: <4007721.1701117710@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: > On 11/27/23 12:11, Atul Kumar wrote: >> I found that localhost was set to .bash_profile and when I removed it >> and then re-attempted to connected the database using "psql postgres", I >> got this new error: >> >> psql postgres -p 5432 >> psql: error: could not connect to server: No such file or directory >>         Is the server running locally and accepting >>         connections on Unix domain socket >> "/var/run/postgresql/.s.PGSQL.5432"? > Do you have more then one version of psql installed? Yeah, that. You're apparently using a version of psql/libpq that thinks the default Unix socket location is /var/run/postgresql; but the postmaster you are using did not create a socket there. (Probably it put one in /tmp instead, which is the out-of-the-box default location. But some distros consider that insecure so they override it, typically to /var/run/postgresql/.) The easiest workaround if you have a mishmash of Postgres libraries is to tell the postmaster to create sockets in both places. See "unix_socket_directories" parameter. regards, tom lane