From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Unable to connect Postgres using psql while postgres is already running.
Date: Wed, 10 Jan 2018 10:10:58 +0100
Message-ID: <1515575458.2848.24.camel@cybertec.at> (raw)
In-Reply-To: <78c05a653d2f4c32aa324daac84ed5ec@cyient.com>
References: <78c05a653d2f4c32aa324daac84ed5ec@cyient.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: laurenz.albe@cybertec.at, Dinesh.Chandra@cyient.com
Subject: Re: Unable to connect Postgres using psql while postgres is already running.
In-Reply-To: <1515575458.2848.24.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox