Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZCPk-0003wB-Tc for pgsql-performance@arkaria.postgresql.org; Wed, 10 Jan 2018 09:11:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZCPk-0007b8-Gg for pgsql-performance@arkaria.postgresql.org; Wed, 10 Jan 2018 09:11:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eZCPk-0007ax-A3 for pgsql-performance@lists.postgresql.org; Wed, 10 Jan 2018 09:11:16 +0000 Received: from mx2.mailbox.org ([80.241.60.215]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eZCPg-0003dV-BH for pgsql-performance@postgresql.org; Wed, 10 Jan 2018 09:11:15 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx2.mailbox.org (Postfix) with ESMTPS id 8FD604117F; Wed, 10 Jan 2018 10:11:10 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id yEG3Ur09QooS; Wed, 10 Jan 2018 10:10:59 +0100 (CET) Message-ID: <1515575458.2848.24.camel@cybertec.at> Subject: Re: Unable to connect Postgres using psql while postgres is already running. From: Laurenz Albe To: Dinesh Chandra 12108 , "pgsql-performance@postgresql.org" Date: Wed, 10 Jan 2018 10:10:58 +0100 In-Reply-To: <78c05a653d2f4c32aa324daac84ed5ec@cyient.com> References: <78c05a653d2f4c32aa324daac84ed5ec@cyient.com> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Dinesh Chandra 12108 wrote: > After restarting PostgreSQL Server, I am unable to connect postgres from putty, I am getting error > > psql: could not connect to server: No such file or directory > Is the server running locally and accepting > connections on Unix domain socket "/tmp/.s.PGSQL.5432"? > > While postgres is already running and also I am able to connect databases from PGAdmin tool but not from command prompt. You know that a local connection only works when you are logged in on the database machine, right? Is your database listening on port 5432? Connect as user "postgres" and run the following queries: SHOW port; SHOW unix_socket_directories; That will show the port and the directories where UNIX sockets are created. You can use a socket directory name with the -h option of psql. Yours, Laurenz Albe