Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9jmu-0000N2-AZ for pgsql-admin@arkaria.postgresql.org; Tue, 09 Oct 2018 04:38:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9jms-0005yi-DE for pgsql-admin@arkaria.postgresql.org; Tue, 09 Oct 2018 04:38:26 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9jms-0005yb-2O for pgsql-admin@lists.postgresql.org; Tue, 09 Oct 2018 04:38:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9jmp-0002IX-M8 for pgsql-admin@postgresql.org; Tue, 09 Oct 2018 04:38:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w994cL6w003191; Tue, 9 Oct 2018 00:38:21 -0400 From: Tom Lane To: pavan95 cc: pgsql-admin@postgresql.org Subject: Re: Error when starting postgres database!! In-reply-to: <1539058967018-0.post@n3.nabble.com> References: <1539058967018-0.post@n3.nabble.com> Comments: In-reply-to pavan95 message dated "Mon, 08 Oct 2018 21:22:47 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3189.1539059901.1@sss.pgh.pa.us> Date: Tue, 09 Oct 2018 00:38:21 -0400 Message-ID: <3190.1539059901@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk pavan95 writes: > I'm facing an error in starting my postgresql database. The error is as > shown below: > bash-4.1$ psql > psql: 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"? Note the error message: it mentions the Unix socket location "/var/run/postgresql/.s.PGSQL.5432". This means the psql (or more precisely, libpq.so) that you're using thinks that PG socket files live in /var/run/postgresql. That is *not* standard; as shipped by the community, PG puts its socket files in "/tmp". However, various distros think that is bad style and override the build option to put the socket files elsewhere, most often /var/run/postgresql. In short, you are probably using a vendor-supplied libpq to try to talk to a PG server that was built from unmodified community code. You could confirm the latter by looking to see if there's a /tmp/.s.PGSQL.5432 socket file. You could use "psql -h /tmp" to override libpq's idea of the socket location, or use "psql -h localhost" to forget about socket files and connect via TCP, or change the server's unix_socket_directories parameter to make it create a socket (or additional socket) in /var/run/postgresql, or replace either your libpq or your server with something that's got the same built-in default location as the other end. regards, tom lane