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 1qQp9Z-0015si-3B for pgsql-general@arkaria.postgresql.org; Tue, 01 Aug 2023 13:11:09 +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 1qQp9V-006LOZ-SD for pgsql-general@arkaria.postgresql.org; Tue, 01 Aug 2023 13:11:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQp9V-006LL0-Go for pgsql-general@lists.postgresql.org; Tue, 01 Aug 2023 13:11:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQp9T-000CSH-Oz for pgsql-general@lists.postgresql.org; Tue, 01 Aug 2023 13:11:06 +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 371DAvxc3069606; Tue, 1 Aug 2023 09:10:59 -0400 From: Tom Lane To: pf@pfortin.com cc: pgsql-general@lists.postgresql.org, Amn Ojee Uw Subject: Re: error: connection to server on socket... In-reply-to: <20230801072849.2faa25f1.pfortin@pfortin.com> References: <97d77785-22a0-5d48-9582-4a7beb2dc14f@gmail.com> <20230801072849.2faa25f1.pfortin@pfortin.com> Comments: In-reply-to pf@pfortin.com message dated "Tue, 01 Aug 2023 07:28:49 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3069604.1690895457.1@sss.pgh.pa.us> Date: Tue, 01 Aug 2023 09:10:57 -0400 Message-ID: <3069605.1690895457@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk pf@pfortin.com writes: > On Tue, 1 Aug 2023 06:22:46 -0400 Amn Ojee Uw wrote: >> "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory*//* > Like mine, your distro probably uses /tmp/.s.PGSQL.5432 > $ ll /tmp/.s.PGSQL.5432 > srwxrwxrwx 1 postgres postgres 0 Aug 1 06:33 /tmp/.s.PGSQL.5432= Yeah. Look to see if there's a socket file there, and if so try sudo -u postgres psql -h /tmp In the longer term, this indicates that you have a psql that did not come from the same packager as your server, because the server thinks the default socket location is /tmp, but psql (or really the libpq.so it's using) thinks the default location is /var/run/postgresql. That's a build-time choice that some packagers make because $standards. So the long-term fix is to not have a hodge-podge of different Postgres installations on the same machine. BTW, you can ignore the "could not change directory" warning. That's expected when starting "sudo -u postgres psql" in a directory that the postgres user can't read. regards, tom lane